mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Code cleanup (#2369)
* Lint travis.yml on https://config.travis-ci.com/explore
* Replace deprecated 'thread_safe' with 'concurrent-ruby' alternative
'thread_safe' gem is now deprecated and merged into 'concurrent-ruby'.
Ref: 52e5f373a9 (diff-42d5a45da331eaa07d2b315bd3c9e738)
* Fix deprecation warning for Ruby 2.7
https://bugs.ruby-lang.org/issues/15539
* Remove a TODO tag that is already resolved
This commit is contained in:
committed by
Benjamin Fleischer
parent
6b093c965f
commit
64c7fee7a8
@@ -35,12 +35,11 @@ module ActiveModel
|
||||
class BookSerializer < ActiveModel::Serializer
|
||||
attributes :title, :author_name
|
||||
end
|
||||
|
||||
test 'resource without a namespace' do
|
||||
book = Book.new(title: 'A Post', author_name: 'hello')
|
||||
|
||||
# TODO: this should be able to pull up this serializer without explicitly specifying the serializer
|
||||
# currently, with no options, it still uses the Api::V3 serializer
|
||||
result = ActiveModelSerializers::SerializableResource.new(book, serializer: BookSerializer).serializable_hash
|
||||
result = ActiveModelSerializers::SerializableResource.new(book).serializable_hash
|
||||
|
||||
expected = { title: 'A Post', author_name: 'hello' }
|
||||
assert_equal expected, result
|
||||
|
||||
Reference in New Issue
Block a user