I’m trying to test some classes in namespace, currently I have this code:
describe Server::SessionController do
it "should create session" do
Server::LoginController.stub(:authenitcate).and_return(session_id)
Server::SessionController....
Server::SessionController....
end
end
How to get rid of repeatable Server namespace?
The RSpec Book ( http://pragprog.com/book/achbd/the-rspec-book ) gives a solution :
So, try to put your spec inside a
Servermodule.HTH.