active_model_serializers/test/action_controller/serialization_test.rb
Steve Klabnik 970b542549 Implement basic rendering
Woo actioncontroller
2014-07-09 17:52:31 -04:00

26 lines
713 B
Ruby

require 'test_helper'
module ActionController
module Serialization
class ImplicitSerializerTest < ActionController::TestCase
class MyController < ActionController::Base
def render_using_implicit_serializer
render json: Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
end
end
tests MyController
# We just have Null for now, this will change
def test_render_using_implicit_serializer
get :render_using_implicit_serializer
assert_equal 'application/json', @response.content_type
assert_equal '{"name":"Name 1","description":"Description 1"}', @response.body
end
end
end
end