Skip to content

Commit

Permalink
Added a (failing) test for when inflecting API
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob McFadzean committed Jul 10, 2015
1 parent 0201f2d commit 506739d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ def test_create_adapter_with_override
adapter = ActiveModel::Serializer::Adapter.create(@serializer, { adapter: :json_api})
assert_equal ActiveModel::Serializer::Adapter::JsonApi, adapter.class
end

def test_inflected_adapter_class_for_known_adapter
ActiveSupport::Inflector.inflections(:en){|inflect| inflect.acronym 'API' }
klass = ActiveModel::Serializer::Adapter.adapter_class(:json_api)

ActiveSupport::Inflector.inflections.acronyms.clear

assert_equal ActiveModel::Serializer::Adapter::JsonApi, klass
end
end
end
end

0 comments on commit 506739d

Please sign in to comment.