mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Fix failing tests
This commit is contained in:
parent
8d31f7ee8c
commit
e1ae39122c
@ -242,7 +242,7 @@ class RenderJsonTest < ActionController::TestCase
|
|||||||
|
|
||||||
def test_render_json_with_callback
|
def test_render_json_with_callback
|
||||||
get :render_json_hello_world_with_callback
|
get :render_json_hello_world_with_callback
|
||||||
assert_equal 'alert({"hello":"world"})', @response.body
|
assert_equal '/**/alert({"hello":"world"})', @response.body
|
||||||
# For JSONP, Rails 3 uses application/json, but Rails 4 uses text/javascript
|
# For JSONP, Rails 3 uses application/json, but Rails 4 uses text/javascript
|
||||||
assert_match %r(application/json|text/javascript), @response.content_type.to_s
|
assert_match %r(application/json|text/javascript), @response.content_type.to_s
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1363,6 +1363,7 @@ class SerializerTest < ActiveModel::TestCase
|
|||||||
def test_inheritance_does_not_used_cached_attributes
|
def test_inheritance_does_not_used_cached_attributes
|
||||||
parent = Class.new(ActiveModel::Serializer) do
|
parent = Class.new(ActiveModel::Serializer) do
|
||||||
attributes :title
|
attributes :title
|
||||||
|
alias :read_attribute_for_serialization :send
|
||||||
end
|
end
|
||||||
|
|
||||||
child = Class.new(parent) do
|
child = Class.new(parent) do
|
||||||
@ -1371,6 +1372,7 @@ class SerializerTest < ActiveModel::TestCase
|
|||||||
|
|
||||||
data_class = Class.new do
|
data_class = Class.new do
|
||||||
attr_accessor :title, :body
|
attr_accessor :title, :body
|
||||||
|
alias :read_attribute_for_serialization :send
|
||||||
end
|
end
|
||||||
|
|
||||||
item = data_class.new
|
item = data_class.new
|
||||||
|
|||||||
@ -199,6 +199,7 @@ class SomeSerializer < ActiveModel::Serializer
|
|||||||
end
|
end
|
||||||
|
|
||||||
class SomeObject < Struct.new(:some)
|
class SomeObject < Struct.new(:some)
|
||||||
|
alias :read_attribute_for_serialization :send
|
||||||
end
|
end
|
||||||
|
|
||||||
# Set up some classes for polymorphic testing
|
# Set up some classes for polymorphic testing
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user