diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 18:06:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 18:06:29 +0000 |
commit | f1bb2a307e9b125a8ee0be3728cb0d1baa21a3d4 (patch) | |
tree | 154817af5e3f1b134be08ef22d1926edf87ab74f /spec/controllers/projects/blame_controller_spec.rb | |
parent | ad1e4b8fb8104b642fa79ed34fd144bc2bed8a19 (diff) | |
download | gitlab-ce-f1bb2a307e9b125a8ee0be3728cb0d1baa21a3d4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/blame_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/blame_controller_spec.rb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/controllers/projects/blame_controller_spec.rb b/spec/controllers/projects/blame_controller_spec.rb index f901fd45604..dd7c0f45dc2 100644 --- a/spec/controllers/projects/blame_controller_spec.rb +++ b/spec/controllers/projects/blame_controller_spec.rb @@ -25,14 +25,25 @@ describe Projects::BlameController do }) end - context "valid file" do + context "valid branch, valid file" do let(:id) { 'master/files/ruby/popen.rb' } + it { is_expected.to respond_with(:success) } end - context "invalid file" do - let(:id) { 'master/files/ruby/missing_file.rb'} - it { expect(response).to have_gitlab_http_status(404) } + context "valid branch, invalid file" do + let(:id) { 'master/files/ruby/invalid-path.rb' } + + it 'redirects' do + expect(subject) + .to redirect_to("/#{project.full_path}/tree/master") + end + end + + context "invalid branch, valid file" do + let(:id) { 'invalid-branch/files/ruby/missing_file.rb'} + + it { is_expected.to respond_with(:not_found) } end end end |