Sha256: cbd5870a89967d1b814738f12604469ec1101c6e2f8b4230ed9eda3a3fa6c7fd
Contents?: true
Size: 585 Bytes
Versions: 2
Compression:
Stored size: 585 Bytes
Contents
require 'test_helper.rb' class DecorateWithContextResponderTest < ActionController::TestCase tests DecorateWithContextController def json JSON[@response.body] end def test_non_decoration DecorateWithContextController.resource = ['abc'] get :index, format: :json assert_equal 1, json.size assert_equal 'abc', json[0] end def test_decoration_with_context DecorateWithContextController.resource = User.new(name: 'John') get :index, format: :json assert_equal 'UserDecorator', json['class'] assert_equal 'bar', json['foo'] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
decorate-responder-2.1.0 | test/decorate_with_context_responder_test.rb |
decorate-responder-2.0.0 | test/decorate_with_context_responder_test.rb |