Sha256: 3547807de58d567e68f34496d59e1b2577d7de47d1ff15404521bc4a15981cae
Contents?: true
Size: 707 Bytes
Versions: 5
Compression:
Stored size: 707 Bytes
Contents
require "test_helper" class NoSerializationScopeTest < ActionController::TestCase class ScopeSerializer def initialize(object, options) @object, @options = object, options end def as_json(*) { :scope => @options[:scope].as_json } end end class ScopeSerializable def active_model_serializer ScopeSerializer end end class NoSerializationScopeController < ActionController::Base serialization_scope nil def index render :json => ScopeSerializable.new end end tests NoSerializationScopeController def test_disabled_serialization_scope get :index, :format => :json assert_equal '{"scope":null}', @response.body end end
Version data entries
5 entries across 5 versions & 1 rubygems