spec/lunetas/candy_spec.rb in lunetas-0.1.0 vs spec/lunetas/candy_spec.rb in lunetas-0.1.1
- old
+ new
@@ -71,9 +71,17 @@
it 'should set another ContentType' do
TestClass.send(:set_content_type, 'text/plain')
@instance.bite[1]["Content-Type"].should == "text/plain"
end
+ it 'should be able to redirect' do
+ mock_env = mock_env('/just_a_test')
+ mock_env['REQUEST_METHOD'] = 'REDIRECT'
+ @instance = TestClass.new(mock_env, ['/just_a_test'])
+ @instance.bite[1].keys.should include('Location')
+ @instance.bite[1].values.should include('http://example.com')
+ end
+
%w{post put delete head trace options}.each do |verb|
it 'should call to the #{verb} method if called with #{verb.upcase}' do
mock_env = mock_env('/just_a_test')
mock_env['REQUEST_METHOD'] = verb.upcase
@instance = TestClass.new(mock_env, ['/just_a_test'])