Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'sample' # <-- your sinatra app
- require 'spec'
- require 'rack/test'
- set :environment, :test
- set :sessions, true
- describe 'The HelloWorld App' do
- include Rack::Test::Methods
- def app
- Sinatra::Application
- end
- it "should say hello using sessions attempt one" do
- get '/', {}, :sessions => {:username => "garren"}
- last_response.should be_ok
- last_response.body.should == 'Hello garren'
- end
- it "should say hello using sessions attempt one" do
- get '/', {}, { "rack.session" => { :username => 'garren'}}
- last_response.should be_ok
- last_response.body.should == 'Hello garren'
- end
- end
Add Comment
Please, Sign In to add comment