From e87f2380779871a64742acdd9dd0358aac7eafce Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 8 Jul 2014 20:25:25 +0200 Subject: Add tests for redirects. --- spec/controllers/blob_controller_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/controllers/blob_controller_spec.rb') diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb index cea6922e1c3..929f6d3b46d 100644 --- a/spec/controllers/blob_controller_spec.rb +++ b/spec/controllers/blob_controller_spec.rb @@ -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 -- cgit v1.2.1