mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Make test attributes explicit
- Organize test poros with associations and by serializer - Freeze derived attributes/associations against mutation - Cleanup PORO fixtures
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
require 'test_helper'
|
||||
|
||||
class NestedPost < ::Model; end
|
||||
class NestedPost < ::Model; associations :nested_posts end
|
||||
class NestedPostSerializer < ActiveModel::Serializer
|
||||
has_many :nested_posts
|
||||
end
|
||||
@@ -301,8 +301,8 @@ module ActiveModelSerializers
|
||||
end
|
||||
|
||||
class NoDuplicatesTest < ActiveSupport::TestCase
|
||||
class Post < ::Model; end
|
||||
class Author < ::Model; end
|
||||
class Post < ::Model; associations :author end
|
||||
class Author < ::Model; associations :posts, :roles, :bio end
|
||||
|
||||
class PostSerializer < ActiveModel::Serializer
|
||||
type 'posts'
|
||||
|
||||
Reference in New Issue
Block a user