You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created two controller tests that test the same controller, but do it for different users (with a different set of privileges).
In the controller tests that tests a visitor I have
setup :activate_authlogic
def setup
UserSession.create(users(:visitor))
end
Which works perfectly. When I remove that code the tests fail because no one is logged on (perfect). However, in another tests, that should tests an admin the code, does not fail when the above is removed. Just to reiterate I'm testing the same controller. What's more, when I do include the code above, it does not work as expected, but does when I include "UserSession.create(users(:admin))" within each test method.
The text was updated successfully, but these errors were encountered:
The error was resolved. Apparently having two identically named controller tests with methods that have the same name will cause issues, who would have known? =P
I've created two controller tests that test the same controller, but do it for different users (with a different set of privileges).
In the controller tests that tests a visitor I have
Which works perfectly. When I remove that code the tests fail because no one is logged on (perfect). However, in another tests, that should tests an admin the code, does not fail when the above is removed. Just to reiterate I'm testing the same controller. What's more, when I do include the code above, it does not work as expected, but does when I include "UserSession.create(users(:admin))" within each test method.
The text was updated successfully, but these errors were encountered: