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>2020-10-15 15:09:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-15 15:09:06 +0300
commit6ae38bb3b5dc719fb6a046dcbcce4671176395a2 (patch)
treeaef1c4118d8371e43c878f366755f19dd702121a /spec/workers/disallow_two_factor_for_subgroups_worker_spec.rb
parent9c72b346ac3b24cca9233a6ebf298659b408513f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/disallow_two_factor_for_subgroups_worker_spec.rb')
-rw-r--r--spec/workers/disallow_two_factor_for_subgroups_worker_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/workers/disallow_two_factor_for_subgroups_worker_spec.rb b/spec/workers/disallow_two_factor_for_subgroups_worker_spec.rb
new file mode 100644
index 00000000000..c3be8263171
--- /dev/null
+++ b/spec/workers/disallow_two_factor_for_subgroups_worker_spec.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe DisallowTwoFactorForSubgroupsWorker do
+ let_it_be(:group) { create(:group) }
+ let_it_be(:subgroup_with_2fa) { create(:group, parent: group, require_two_factor_authentication: true) }
+ let_it_be(:subgroup_without_2fa) { create(:group, parent: group, require_two_factor_authentication: false) }
+ let_it_be(:subsubgroup_with_2fa) { create(:group, parent: subgroup_with_2fa, require_two_factor_authentication: true) }
+
+ it "schedules updating subgroups" do
+ expect(DisallowTwoFactorForGroupWorker).to receive(:perform_in).with(0, subgroup_with_2fa.id)
+ expect(DisallowTwoFactorForGroupWorker).to receive(:perform_in).with(2, subsubgroup_with_2fa.id)
+
+ described_class.new.perform(group.id)
+ end
+end