spec/compel/compel_spec.rb in compel-0.1.2 vs spec/compel/compel_spec.rb in compel-0.1.3

- old
+ new

@@ -202,11 +202,11 @@ line_two: 'Portugal' }, errors: { address: { line_one: ['is required'], - post_code: ['params must be an Hash'] + post_code: ['is required'] } } }) end @@ -300,9 +300,32 @@ county: { code: ['is required'] } } } + } + }) + + end + + it 'should not compel 4' do + params = { + address: nil + } + + expect(make_the_call(:run, params)).to eq \ + Hashie::Mash.new({ + errors: { + address: ['is required'] + } + }) + end + + it 'should not compel 5' do + expect(make_the_call(:run, {})).to eq \ + Hashie::Mash.new({ + errors: { + address: ['is required'] } }) end end