Merge branch '0-9-1' into 0-9-stable

This will bring back all features in 0.9.1 minus the problematic
Enumerable commit that broke it.
This commit is contained in:
Alexandre de Oliveira
2015-01-21 22:01:14 -02:00
5 changed files with 3 additions and 23 deletions

View File

@@ -100,10 +100,6 @@ class ProfileSerializer < ActiveModel::Serializer
attributes :name, :description
end
class DifferentProfileSerializer < ActiveModel::Serializer
attributes :name
end
class CategorySerializer < ActiveModel::Serializer
attributes :name

View File

@@ -283,21 +283,5 @@ module ActionController
assert_equal("{\"my\":[{\"name\":\"Name 1\",\"email\":\"mail@server.com\",\"profile_id\":#{@controller.user.profile.object_id}}],\"profiles\":[{\"name\":\"N1\",\"description\":\"D1\"}]}", @response.body)
end
end
class ExplicitEachSerializerWithEnumarableObjectTest < ActionController::TestCase
class MyController < ActionController::Base
def render_array
render json: [Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })].to_enum, each_serializer: DifferentProfileSerializer
end
end
tests MyController
def test_render_array
get :render_array
assert_equal 'application/json', @response.content_type
assert_equal '{"my":[{"name":"Name 1"}]}', @response.body
end
end
end
end