Sha256: afffc7f89429735a91d3165f524d2052e840ef3b5531cfccb9d36c379832a98f
Contents?: true
Size: 1.03 KB
Versions: 1
Compression:
Stored size: 1.03 KB
Contents
# require 'test_helper' # # module ActionController # module Serialization # class ImplicitSerializerTest < ActionController::TestCase # class PostWithoutSerializer < ActiveRecord::Base # self.table_name = :posts # end # class ImplicitSerializationTestController < ActionController::Base # def render_record_without_serializer # @post = PostWithoutSerializer.new(title: 'Title', body: 'Body') # render json: @post # end # end # # tests ImplicitSerializationTestController # # def test_record_without_serializer # with_adapter :json do # get :render_record_without_serializer # end # # expected = {} # PostWithoutSerializer.column_names.each { |field| expected[field] ||= nil } # expected.update( # title: 'Title', # body: 'Body' # ) # # assert_equal 'application/json', @response.content_type # assert_equal expected.to_json, @response.body # end # end # end # end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
active_model_serializers-0.9.7 | test/action_controller/regression_test.rb |