Skip to content

Commit

Permalink
Merge pull request #2007 from bf4/check_ci
Browse files Browse the repository at this point in the history
Test was failing due to change in JSON exception message when parsing empty string
  • Loading branch information
bf4 authored Dec 23, 2016
2 parents 95f832f + c1fc0e4 commit 3f46846
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/active_model_serializers/test/schema_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,16 @@ def test_with_a_non_existent_file
end

def test_that_raises_with_a_invalid_json_body
message = 'A JSON text must at least contain two octets!'
# message changes from JSON gem 2.0.2 to 2.2.0
message = /A JSON text must at least contain two octets!|an unexpected token at ''/

get :invalid_json_body

error = assert_raises ActiveModelSerializers::Test::Schema::InvalidSchemaError do
assert_response_schema('custom/show.json')
end

assert_equal(message, error.message)
assert_match(message, error.message)
end
end
end
Expand Down

0 comments on commit 3f46846

Please sign in to comment.