Class: ActionDispatch::TestResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/jets/testing/ext/action_dispatch_test_response.rb

Overview

Make response less verbose (for RSpec failure messages).

Before:

expected `#<ActionDispatch::TestResponse:0x000055c409b14a40
            @mon_owner=nil, @mon_count=0,
            @mon_mutex=#<Thread::...ext/html", @hash=459027022919608650>,
            @charset="utf-8", @cache_control={:no_cache=>true},
            @etag=nil>.success?` to return true, got false

After:

expected `TestResponse<status: 302, content-type: text/html,
                       body: "<html><body>You are being redirected</a>..."
                     >.success?` to return true, got false

Instance Method Summary collapse

Instance Method Details

#inspectObject



18
19
20
21
22
# File 'lib/jets/testing/ext/action_dispatch_test_response.rb', line 18

def inspect
  "TestResponse<status: #{status}, " \
  "content-type: #{content_type}, " \
  "body: \"#{body.truncate(200)}\">"
end