biola/rack-cas — pull request #13 by senny (2014-01-17 10:41:30+00:00)
Title: Configure extra attributes for `Rack::FakeCAS`

Our application relies on some data passed through the `extra_attributes`. To simulate that workflow in the tests it would be great to have `Rack::FakeCAS` return these attributes.

This patch allows you to configure `extra_attributes` for testing.
The configuration is passed when instantiating the `Rack::FakeCAS` middleware:

use Rack::FakeCAS, {}, {"jane" => {"name" => "Jane Doe"}}

The Hash has the following structure:

{ => }

As Rails users most likely do not configure `Rack::FakeCAS` themselves they can
pass the configuration throuth `Rails.application.config`:

config.rack_cas.fake_attributes = {"jane" => {"name" => "Jane Doe"}}

### Sidenote

I included a commit to remove trailing whitespace in the files I touched. Please let me know if you want to keep the files as they are and I'm going to remove that patch.