Test attributes declared as strings

Thanks @mikegee

Closes #380
This commit is contained in:
Santiago Pastorino 2013-10-22 11:54:42 -02:00
parent db086794c6
commit 06e4c2c9d6
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class ARTagSerializer < ActiveModel::Serializer
end end
class ARSectionSerializer < ActiveModel::Serializer class ARSectionSerializer < ActiveModel::Serializer
attributes :name attributes 'name'
end end
ARPost.create(title: 'New post', ARPost.create(title: 'New post',

View File

@ -17,7 +17,7 @@ module ActiveModel
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] }, ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }], { body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }], ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
ar_section: { name: 'ruby' } ar_section: { 'name' => 'ruby' }
} }
}, post_serializer.as_json) }, post_serializer.as_json)
end end
@ -51,7 +51,7 @@ module ActiveModel
ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] }, ar_comments: [{ body: 'what a dumb post', ar_tags: [{ name: 'short' }, { name: 'whiny' }] },
{ body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }], { body: 'i liked it', ar_tags: [{:name=>"short"}, {:name=>"happy"}] }],
ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }], ar_tags: [{ name: 'short' }, { name: 'whiny' }, { name: 'happy' }],
ar_section: { name: 'ruby' } ar_section: { 'name' => 'ruby' }
}, post_serializer.as_json) }, post_serializer.as_json)
end end
end end