I wanted to create a module because i needed to execute some methods upon every controller action of my application. Thus, i created a module and used a before_filter to my application开发者_StackOverflow中文版 controller, so that it runs for every action.
This module is like a controller extension, since it handles redirects and has some methods as well. I need to have a logged in user to check that, but for some reason, the macro that i have for my other controllers is not recognized :
require 'spec_helper'
require 'devise/test_helpers'
describe GameEngine::GameLoop do
login_user
it "should check tavern quest" do
...
end
end
I get that login_user is undefined, though it works for all my controller, where i need it. Why isn't it recognized on the module ?
精彩评论