mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
fixed issue with rendering Hash which appears in rails 4.2.0.beta4
This commit is contained in:
@@ -19,6 +19,10 @@ module ActionController
|
||||
def render_comments
|
||||
render json: [Comment.new(content: 'Comment 1')]
|
||||
end
|
||||
|
||||
def render_hash
|
||||
render json: {message: 'not found'}, status: 404
|
||||
end
|
||||
end
|
||||
|
||||
tests TestNamespace::MyController
|
||||
@@ -42,6 +46,11 @@ module ActionController
|
||||
get :render_comments
|
||||
assert_serializer CommentSerializer
|
||||
end
|
||||
|
||||
def test_render_hash_regression
|
||||
get :render_hash
|
||||
assert_equal JSON.parse(response.body), {'message' => 'not found'}
|
||||
end
|
||||
end
|
||||
|
||||
class OptionNamespacedSerializationTest < ActionController::TestCase
|
||||
@@ -93,4 +102,4 @@ module ActionController
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user