The fact that NotfierController sets the message is not relevant to an
isolated example of the behavior of SendQueuesController. In a
controller spec, you have access to the session before the the action
is invoked, so:
describe SendQueuesController do
describe "GET #some_action" do
it "passes session[:message] to SomeClass" do
session[:message] = "session message"
SomeClass.should_receive(:some_message).with("session message")
get :some_action
end
end
end
HTH,
David
PS - it's generally better to post code snippets than describe the
code. My response is filled with assumptions that may or may not be
correct, and working against a code snippet would reduce the amount of
guessing.