diff --git a/test/app/controllers/api/test/active_model_serializer/marbles_controller.rb b/test/app/controllers/api/test/active_model_serializer/marbles_controller.rb deleted file mode 100644 index da44b5c..0000000 --- a/test/app/controllers/api/test/active_model_serializer/marbles_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Api::Test::ActiveModelSerializer::MarblesController < Api::TestController - include RESTFramework::ModelControllerMixin - - self.serializer_class = MarbleSerializer -end diff --git a/test/app/controllers/api/test/active_model_serializer/users_controller.rb b/test/app/controllers/api/test/active_model_serializer/users_controller.rb new file mode 100644 index 0000000..6e29cff --- /dev/null +++ b/test/app/controllers/api/test/active_model_serializer/users_controller.rb @@ -0,0 +1,5 @@ +class Api::Test::ActiveModelSerializer::UsersController < Api::TestController + include RESTFramework::ModelControllerMixin + + self.serializer_class = UserSerializer +end diff --git a/test/test/controllers/api/test/active_model_serializer/marbles_controller_test.rb b/test/test/controllers/api/test/active_model_serializer/users_controller_test.rb similarity index 76% rename from test/test/controllers/api/test/active_model_serializer/marbles_controller_test.rb rename to test/test/controllers/api/test/active_model_serializer/users_controller_test.rb index c7904b9..9d5ecf6 100644 --- a/test/test/controllers/api/test/active_model_serializer/marbles_controller_test.rb +++ b/test/test/controllers/api/test/active_model_serializer/users_controller_test.rb @@ -6,9 +6,10 @@ def test_list User.create!(login: "test", manager_attributes: {login: "test2"}) get(:index, as: :json) assert_response(:success) - assert(@response.parsed_body[0]["login"]) - assert(@response.parsed_body[0]["manager"]) - assert_equal("working!", @response.parsed_body[0]["test_serializer_method"]) + puts @response.parsed_body + assert(@response.parsed_body[1]["login"]) + assert(@response.parsed_body[1]["manager"]) + assert_equal("working!", @response.parsed_body[1]["test_serializer_method"]) assert_nil(@response.parsed_body[0]["calculated_property"]) end