Skip to content

Commit 8bd45db

Browse files
committed
Test with Breed returning :accepted instead of :created
1 parent 8014f4b commit 8bd45db

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

test/controllers/controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ def test_poro_create_simple
19831983
}
19841984
}
19851985

1986-
assert_response :created
1986+
assert_response :accepted
19871987
assert json_response['data'].is_a?(Hash)
19881988
assert_equal 'Tabby', json_response['data']['attributes']['name']
19891989
end
@@ -2017,7 +2017,7 @@ def test_poro_create_update
20172017
}
20182018
}
20192019

2020-
assert_response :created
2020+
assert_response :accepted
20212021
assert json_response['data'].is_a?(Hash)
20222022
assert_equal 'Calic', json_response['data']['attributes']['name']
20232023

test/fixtures/active_record.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,11 @@ def self.find(filters, options = {})
701701
def self.find_by_key(id, options = {})
702702
BreedResource.new($breed_data.breeds[id.to_i], options[:context])
703703
end
704+
705+
def _save
706+
super
707+
return :accepted
708+
end
704709
end
705710

706711
class PlanetResource < JSONAPI::Resource

0 commit comments

Comments
 (0)