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:
Wasif Hossain
2020-01-03 08:53:59 +06:00
committed by Benjamin Fleischer
parent 6b093c965f
commit 64c7fee7a8
5 changed files with 18 additions and 17 deletions

View File

@@ -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