search for: login_with_account

Displaying 1 result from an estimated 1 matches for "login_with_account".

2008 Jan 30
2
Stubbing controller methods vs model methods
...count @account = Account.for(request.host.split(".").first) #TODO: find out why request.subdomains returns [] end In my controller tests I would like to stub this method. So I created a method within the authenticated_test_helper.rb (I am using RESTful Authentication plugin) def login_with_account(account) # <=== # User current_user = mock_model(User) controller.stub!(:current_user).and_return(current_user) # User''s account account.stub!(:users).and_return([current_user]) current_user.stub!(:account).and_return(account) # Application methods con...