Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
balvig committed Aug 19, 2019
1 parent bbc7810 commit f7d7076
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/orm_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ def test_create_with_server_returning_string_validation_errors
assert_requested endpoint
end

def test_create_with_server_returning_validation_errors_on_associations
endpoint = stub_request(:put, 'http://sushi.com/recipes/1').to_return_json(id: 'write_error:400', errors: { :"groups.title" => [{ error: 'too_short' }]})

recipe = Recipe.create(id: 1)

assert_equal ["Groups title is too short"], recipe.errors.full_messages
assert_requested endpoint
end

def test_find_using_custom_uri_template
endpoint = stub_request(:get, 'http://sushi.com/images/photos/1').to_return_json(result: { id: 1 })
Photo.find(1)
Expand Down

0 comments on commit f7d7076

Please sign in to comment.