Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-29 15:09:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-29 15:09:26 +0300
commitf167d24074de8777f1d445af884a7315763aa213 (patch)
treec75eefd36755cd38eda7acf610b6af6e20acd402 /spec/controllers
parent3fdeaff80e055fb6fef3d82b60bbecdca1c25fc7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/import/fogbugz_controller_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/controllers/import/fogbugz_controller_spec.rb b/spec/controllers/import/fogbugz_controller_spec.rb
index 386bfcb8b3a..ed2a588eadf 100644
--- a/spec/controllers/import/fogbugz_controller_spec.rb
+++ b/spec/controllers/import/fogbugz_controller_spec.rb
@@ -29,12 +29,21 @@ RSpec.describe Import::FogbugzController do
expect(response).to redirect_to(new_user_map_import_fogbugz_path)
end
- it 'preserves namespace_id query param' do
+ it 'preserves namespace_id query param on success' do
post :callback, params: { uri: uri, email: 'test@example.com', password: 'mypassword', namespace_id: namespace_id }
expect(response).to redirect_to(new_user_map_import_fogbugz_path(namespace_id: namespace_id))
end
+ it 'redirects to new page maintaining namespace_id when client raises standard error' do
+ namespace_id = 5
+ allow(::Gitlab::FogbugzImport::Client).to receive(:new).and_raise(StandardError)
+
+ post :callback, params: { uri: uri, email: 'test@example.com', password: 'mypassword', namespace_id: namespace_id }
+
+ expect(response).to redirect_to(new_import_fogbugz_url(namespace_id: namespace_id))
+ end
+
it 'redirects to new page form when client raises authentication exception' do
allow(::Gitlab::FogbugzImport::Client).to receive(:new).and_raise(::Fogbugz::AuthenticationException)