How would I go about writing specs for methods in the Application
Controller:
I'm thinking of simple methods that do authentication, through before
filters or for example how might I spec this method in an
application_spec.rb?
def store_location
session[:return_to] = request.request_uri
end
The trouble is I'm not generating a request object as the methods are to
be used by all controllers... I've tried stubbing...
request = mock_model(URI::HTTP, :request_uri => "something")
...or setting the variable in the spec itself...
request.response_uri = "something"
...but I can't seem to get the approach right!
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users