spec/angelo_spec.rb in angelo-0.1.4 vs spec/angelo_spec.rb in angelo-0.1.5
- old
+ new
@@ -24,10 +24,14 @@
content_type :json
params
end
end
+ get '/redirect' do
+ redirect '/'
+ end
+
end
it 'responds to http requests properly' do
Angelo::HTTPABLE.each do |m|
__send__ m, '/'
@@ -43,10 +47,16 @@
it 'responds to post requests with json properly' do
post '/json', obj.to_json, {'Content-Type' => Angelo::JSON_TYPE}
last_response_should_be_json obj
end
+ it 'redirects' do
+ get '/redirect'
+ expect(last_response.status).to eq(301)
+ expect(last_response.headers['Location']).to eq('/')
+ end
+
end
describe 'before filter' do
define_app do
@@ -301,11 +311,8 @@
it 'does not parse body when request content-type not set' do
post '/json', obj, {'Content-Type' => ''}
last_response_should_be_json({})
end
- end
-
- describe 'websockets helper' do
end
end