```ruby
module ActionController
  module TestResponseStringOverride
    def to_s
      status, headers, body = to_a
      body = ''.tap { |out| body.each { |s| out << s } }
      "#<#{self.class.name} #{request.method} #{request.fullpath} => " \
        "[#{status}, #{body.inspect}, #{headers.inspect}]>"
    end

    def inspect
      to_s
    end
  end

  RSpec.configure do |config|
    config.before(:suite) do
      TestResponse.send(:include, TestResponseStringOverride)
    end
  end
end
```

Fix bug with TestResponse override outside Rails
user
```ruby
module ActionController
  module TestResponseStringOverride
    def to_s
      status, headers, body = to_a
      body = ''.tap { |out| body.each { |s| out << s } }
      "#<#{self.class.name} #{request.method} #{request.fullpath} => " \
        "[#{status}, #{body.inspect}, #{headers.inspect}]>"
    end

    def inspect
      to_s
    end
  end

  RSpec.configure do |config|
    config.before(:suite) do
      if defined?(TestResponse)
        TestResponse.send(:include, TestResponseStringOverride)
      end
    end
  end
end
```
assistant