spec/innate/session.rb in manveru-innate-2009.04 vs spec/innate/session.rb in manveru-innate-2009.04.01
- old
+ new
@@ -27,28 +27,29 @@
session.clear
end
end
describe Innate::Session do
- behaves_like :mock
+ behaves_like :session
should 'initiate session as needed' do
- get '/'
- last_response.body.should == 'No session here'
- last_response['Set-Cookie'].should == nil
+ session do |mock|
+ response = mock.get('/')
+ response.body.should == 'No session here'
+ response['Set-Cookie'].should == nil
- get('/init')
- last_response.body.should == '0'
+ mock.get('/init').body.should == '0'
- 1.upto(10) do |n|
- get('/increment').body.should == n.to_s
- end
+ 1.upto(10) do |n|
+ mock.get('/increment').body.should == n.to_s
+ end
- get('/reset')
- get('/view').body.should == ''
- get('/init').body.should == '0'
+ mock.get('/reset')
+ mock.get('/view').body.should == ''
+ mock.get('/init').body.should == '0'
- -1.downto(-10) do |n|
- get('/decrement').body.should == n.to_s
+ -1.downto(-10) do |n|
+ mock.get('/decrement').body.should == n.to_s
+ end
end
end
end