BigW Consortium Gitlab

Commit e87f2380 by Marin Jankovski

Add tests for redirects.

parent 005752e4
......@@ -34,4 +34,18 @@ describe Projects::BlobController do
it { should respond_with(:not_found) }
end
end
describe 'GET show with tree path' do
render_views
before do
get :show, project_id: project.to_param, id: id
controller.instance_variable_set(:@blob, nil)
end
context 'redirect to tree' do
let(:id) { 'master/doc' }
it { should redirect_to("/#{project.path_with_namespace}/tree/master/doc") }
end
end
end
......@@ -40,4 +40,17 @@ describe Projects::TreeController do
it { should respond_with(:not_found) }
end
end
describe 'GET show with blob path' do
render_views
before do
get :show, project_id: project.to_param, id: id
end
context 'redirect to blob' do
let(:id) { 'master/README.md' }
it { should redirect_to("/#{project.path_with_namespace}/blob/master/README.md") }
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment