tags:

views:

314

answers:

1

Hi All,

I have sinatra appliction using session, how do I test a page that uses session?

I using Rspec + sinatra

Tks

A: 

Same like all other pages.

You need to clarify your question. What is problem with testing session. If problems is that user need to be logged in, then you can use something like this in spec file:

before :each do
  post "/login", {:username => "myuser", :password => "mypass"}
end

which will log you in before each test.

Rubycut