diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 14 | ||||
-rw-r--r-- | spec/controllers/concerns/confirm_email_warning_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/uploads_controller_spec.rb | 24 |
3 files changed, 21 insertions, 19 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 481883c50fa..94afe741057 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -90,16 +90,18 @@ describe ApplicationController do let(:format) { :html } it_behaves_like 'setting gon variables' - end - context 'with json format' do - let(:format) { :json } + context 'for peek requests' do + before do + request.path = '/-/peek' + end - it_behaves_like 'not setting gon variables' + it_behaves_like 'not setting gon variables' + end end - context 'with atom format' do - let(:format) { :atom } + context 'with json format' do + let(:format) { :json } it_behaves_like 'not setting gon variables' end diff --git a/spec/controllers/concerns/confirm_email_warning_spec.rb b/spec/controllers/concerns/confirm_email_warning_spec.rb index 0c598a360af..25429cdd149 100644 --- a/spec/controllers/concerns/confirm_email_warning_spec.rb +++ b/spec/controllers/concerns/confirm_email_warning_spec.rb @@ -19,7 +19,7 @@ describe ConfirmEmailWarning do RSpec::Matchers.define :set_confirm_warning_for do |email| match do |response| - expect(response).to set_flash.now[:warning].to include("Please check your email (#{email}) to verify that you own this address.") + expect(response).to set_flash.now[:warning].to include("Please check your email (#{email}) to verify that you own this address and unlock the power of CI/CD.") end end diff --git a/spec/controllers/uploads_controller_spec.rb b/spec/controllers/uploads_controller_spec.rb index f35babc1b56..1bcf3bb106b 100644 --- a/spec/controllers/uploads_controller_spec.rb +++ b/spec/controllers/uploads_controller_spec.rb @@ -228,10 +228,10 @@ describe UploadsController do user.block end - it "responds with status 401" do + it "redirects to the sign in page" do get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" } - expect(response).to have_gitlab_http_status(401) + expect(response).to redirect_to(new_user_session_path) end end @@ -320,10 +320,10 @@ describe UploadsController do end context "when not signed in" do - it "responds with status 401" do + it "redirects to the sign in page" do get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } - expect(response).to have_gitlab_http_status(401) + expect(response).to redirect_to(new_user_session_path) end end @@ -343,10 +343,10 @@ describe UploadsController do project.add_maintainer(user) end - it "responds with status 401" do + it "redirects to the sign in page" do get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } - expect(response).to have_gitlab_http_status(401) + expect(response).to redirect_to(new_user_session_path) end end @@ -439,10 +439,10 @@ describe UploadsController do user.block end - it "responds with status 401" do + it "redirects to the sign in page" do get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" } - expect(response).to have_gitlab_http_status(401) + expect(response).to redirect_to(new_user_session_path) end end @@ -526,10 +526,10 @@ describe UploadsController do end context "when not signed in" do - it "responds with status 401" do + it "redirects to the sign in page" do get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } - expect(response).to have_gitlab_http_status(401) + expect(response).to redirect_to(new_user_session_path) end end @@ -549,10 +549,10 @@ describe UploadsController do project.add_maintainer(user) end - it "responds with status 401" do + it "redirects to the sign in page" do get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } - expect(response).to have_gitlab_http_status(401) + expect(response).to redirect_to(new_user_session_path) end end |