We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
First include the following in your TestCase or 'describe' block:
include Sorcery::TestHelpers::Sinatra
Now in your 'setup' or 'before(:each)' block make sure to call this line:
::Sinatra::Application.rack_test_session = rack_test_session # Sinatra::Base should work too
This helps us access the session in a context outside of a request.
Now you can use the following helpers in your tests:
login_user(user = nil) # by default looks for @user logout_user
For a working example see example sinatra app.
There was an error while loading. Please reload this page.