spec/unit/key/property/builder_spec.rb in rest_model-0.1.19 vs spec/unit/key/property/builder_spec.rb in rest_model-0.1.20
- old
+ new
@@ -31,11 +31,11 @@
id
end
end
let(:field) {:id}
- let(:options) {{id: true}}
+ let(:options) {{id: true, validate: true}}
it_behaves_like "a property"
it_behaves_like "a key"
end
@@ -45,11 +45,11 @@
id :different_name
end
end
let(:field) {:different_name}
- let(:options) {{id: true}}
+ let(:options) {{id: true, validate: true}}
it_behaves_like "a property"
it_behaves_like "a key"
end
@@ -59,11 +59,11 @@
id some_option: 'some option value'
end
end
let(:field) {:id}
- let(:options) {{some_option: 'some option value', id: true}}
+ let(:options) {{some_option: 'some option value', id: true, validate: true}}
it_behaves_like "a property"
it_behaves_like "a key"
end
@@ -73,11 +73,11 @@
id :different_name, some_option: 'some option value'
end
end
let(:field) {:different_name}
- let(:options) {{some_option: 'some option value', id: true}}
+ let(:options) {{some_option: 'some option value', id: true, validate: true}}
it_behaves_like "a property"
it_behaves_like "a key"
end
@@ -87,11 +87,11 @@
id id: false
end
end
let(:field) {:id}
- let(:options) {{id: true}}
+ let(:options) {{id: true, validate: true}}
it_behaves_like "a property"
it_behaves_like "a key"
end
end
@@ -103,11 +103,11 @@
property :document_number, some_option: 'this is an option'
end
end
let(:field) {:document_number}
- let(:options) {{some_option: 'this is an option'}}
+ let(:options) {{some_option: 'this is an option', validate: true}}
it_behaves_like "a property"
end
context "when it has the option :id set to true" do
@@ -116,11 +116,11 @@
property :document_number, id: true
end
end
let(:field) {:document_number}
- let(:options) {{id: true}}
+ let(:options) {{id: true, validate: true}}
it_behaves_like "a property"
it_behaves_like "a key"
end
end
@@ -134,19 +134,19 @@
end
[:id, :description].each do |item|
context "for #{item}" do
let(:field) {item}
- let(:options) {{}}
+ let(:options) {{validate: true}}
it_behaves_like "a property"
end
end
[:price, :quantity].each do |item|
context "for #{item}" do
let(:field) {item}
- let(:options) {{firstoption: 'this is the first option', secondoption: 'this is the second option'}}
+ let(:options) {{firstoption: 'this is the first option', secondoption: 'this is the second option', validate: true}}
it_behaves_like "a property"
end
end
end