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 am struggling with how to test authentication using RSpec 2.0. I can verify that authentication and signup works manually, but in my spec I run in to some problems. I create users in the database, and try to manually assign my create user id to the session variable, like so:
session[:user] = @user.id
I have verified that @user exists and is valid. However, I get the following error:
NameError:
undefined local variable or method `session' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x000001019967c0>
How can I log users in programatically in my tests? I am including my "app.rb" file that includes sinatra-authentication and the rest of my gems, so I don't know why "session" doesn't exist.
I am struggling with how to test authentication using RSpec 2.0. I can verify that authentication and signup works manually, but in my spec I run in to some problems. I create users in the database, and try to manually assign my create user id to the session variable, like so:
I have verified that @user exists and is valid. However, I get the following error:
How can I log users in programatically in my tests? I am including my "app.rb" file that includes sinatra-authentication and the rest of my gems, so I don't know why "session" doesn't exist.
@huboard:{"order":10.75}
The text was updated successfully, but these errors were encountered: