diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/controllers/projects/issues_controller_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/controllers/projects/issues_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/issues_controller_spec.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index ed5198bf015..f956baa0e22 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -388,15 +388,23 @@ RSpec.describe Projects::IssuesController do # Rails router. A controller-style spec matches the wrong route, and # session['user_return_to'] becomes incorrect. describe 'Redirect after sign in', type: :request do - context 'with an AJAX request' do + before_all do + project.add_developer(user) + end + + before do + login_as(user) + end + + context 'with a JSON request' do it 'does not store the visited URL' do - get project_issue_path(project, issue), xhr: true + get project_issue_path(project, issue, format: :json) expect(session['user_return_to']).to be_blank end end - context 'without an AJAX request' do + context 'with an HTML request' do it 'stores the visited URL' do get project_issue_path(project, issue) @@ -1642,7 +1650,7 @@ RSpec.describe Projects::IssuesController do end it 'allows CSV export' do - expect(ExportCsvWorker).to receive(:perform_async).with(viewer.id, project.id, anything) + expect(IssuableExportCsvWorker).to receive(:perform_async).with(:issue, viewer.id, project.id, anything) request_csv @@ -1657,7 +1665,7 @@ RSpec.describe Projects::IssuesController do it 'redirects to the sign in page' do request_csv - expect(ExportCsvWorker).not_to receive(:perform_async) + expect(IssuableExportCsvWorker).not_to receive(:perform_async) expect(response).to redirect_to(new_user_session_path) end end |