rails/rails — pull request #15948 by MGerrior (2014-06-27 22:01:22+00:00)
Title: Fix test session fetch

This pull request fixes an issue when passing two arguments or a block to `session#fetch` in an application controller. The `ActionController::TestSession` currently extends `Rack::Session::Abstract::SessionHash` which aliases `#fetch` to `#[]` which only takes one argument. This causes an `ArgumentError: wrong number of arguments (2 for 1)` error to be raised when testing a controller that executes code such as

```ruby
class HomeController < ApplicationController
def index
@title = session.fetch(:title, 'Hello, world!')
end
end
```

I've subsequently created a simple rails application that produces the error at https://github.com/MGerrior/SessionTestApp/ . Please let me know if any changes are necessary to move this forward.