fix issue #185 (non consistent json error handling of submittable content types)

did committed Apr 29, 2014
commit 2616626e8e401ac79862ea7308582818f0cff1bb
Showing 2 changed files with 2 additions and 4 deletions
locomotive/wagon/server/entry_submission.rb b/lib/locomotive/wagon/server/entry_submission.rb +1 -3
@@ @@ -109,9 +109,7 @@ module Locomotive::Wagon
end
end
- [status, { 'Content-Type' => 'application/json' }, [
- { @content_type.slug.singularize => hash }.to_json
- ]]
+ [status, { 'Content-Type' => 'application/json' }, [hash.to_json]]
end
end
spec/integration/server/contact_form_spec.rb +1 -1
@@ @@ -29,7 +29,7 @@ describe 'ContactForm' do
describe 'with json request' do
let(:response) { post_contact_form(params, true) }
- let(:entry) { JSON.parse(response.body)['message'] }
+ let(:entry) { JSON.parse(response.body) }
context 'when not valid' do