Fix failing tests

This commit is contained in:
mhuggins 2015-11-05 23:03:31 -07:00 committed by Benjamin Fleischer
parent 8d31f7ee8c
commit e1ae39122c
3 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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