Follows inheritance with a namespace

Co-authored-by: Rafael Gaspar <rafael.gaspar@me.com>
Co-authored-by: Darryl Pogue <darryl@dpogue.ca>
Co-authored-by: Artin Boghosian <artinboghosian@gmail.com>
This commit is contained in:
Rafael Gaspar
2017-09-04 10:28:18 -03:00
committed by Darryl Pogue
parent 777fab04ae
commit beffbb2bd3
3 changed files with 8 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ module ActiveModel
attributes :title, :author_name
associations :publisher, :pages
end
class Ebook < Book; end
class Page < ::Model; attributes :number, :text end
class Publisher < ::Model; attributes :name end
@@ -85,6 +86,11 @@ module ActiveModel
}
assert_equal expected, result
end
test 'follows inheritance with a namespace' do
serializer = ActiveModel::Serializer.serializer_for(Ebook.new, namespace: Api::V3)
assert_equal Api::V3::BookSerializer, serializer
end
end
end
end