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:
@@ -4,9 +4,17 @@ module ActiveModelSerializers
|
||||
module Adapter
|
||||
class JsonApi
|
||||
class KeyCaseTest < ActiveSupport::TestCase
|
||||
class Post < ::Model; end
|
||||
class Author < ::Model; end
|
||||
class Comment < ::Model; end
|
||||
class Post < ::Model
|
||||
attributes :title, :body, :publish_at
|
||||
associations :author, :comments
|
||||
end
|
||||
class Author < ::Model
|
||||
attributes :first_name, :last_name
|
||||
end
|
||||
class Comment < ::Model
|
||||
attributes :body
|
||||
associations :author, :post
|
||||
end
|
||||
|
||||
class PostSerializer < ActiveModel::Serializer
|
||||
type 'posts'
|
||||
|
||||
Reference in New Issue
Block a user