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:
Diffstat (limited to 'spec/helpers/form_helper_spec.rb')
-rw-r--r--spec/helpers/form_helper_spec.rb83
1 files changed, 18 insertions, 65 deletions
diff --git a/spec/helpers/form_helper_spec.rb b/spec/helpers/form_helper_spec.rb
index 7c8c59be409..83b08e5fcec 100644
--- a/spec/helpers/form_helper_spec.rb
+++ b/spec/helpers/form_helper_spec.rb
@@ -6,38 +6,15 @@ RSpec.describe FormHelper do
include Devise::Test::ControllerHelpers
describe '#dropdown_max_select' do
- let(:feature_flag) { :limit_reviewer_and_assignee_size }
-
- context "with the :limit_reviewer_and_assignee_size feature flag on" do
- before do
- stub_feature_flags(feature_flag => true)
- end
-
- it 'correctly returns the max amount of reviewers or assignees to allow' do
- max = Issuable::MAX_NUMBER_OF_ASSIGNEES_OR_REVIEWERS
-
- expect(helper.dropdown_max_select({}, feature_flag))
- .to eq(max)
- expect(helper.dropdown_max_select({ 'max-select'.to_sym => 5 }, feature_flag))
- .to eq(5)
- expect(helper.dropdown_max_select({ 'max-select'.to_sym => max + 5 }, feature_flag))
- .to eq(max)
- end
- end
-
- context "with the :limit_reviewer_and_assignee_size feature flag off" do
- before do
- stub_feature_flags(feature_flag => false)
- end
-
- it 'correctly returns the max amount of reviewers or assignees to allow' do
- expect(helper.dropdown_max_select({}, feature_flag))
- .to eq(nil)
- expect(helper.dropdown_max_select({ 'max-select'.to_sym => 5 }, feature_flag))
- .to eq(5)
- expect(helper.dropdown_max_select({ 'max-select'.to_sym => 120 }, feature_flag))
- .to eq(120)
- end
+ it 'correctly returns the max amount of reviewers or assignees to allow' do
+ max = Issuable::MAX_NUMBER_OF_ASSIGNEES_OR_REVIEWERS
+
+ expect(helper.dropdown_max_select({}))
+ .to eq(max)
+ expect(helper.dropdown_max_select({ 'max-select'.to_sym => 5 }))
+ .to eq(5)
+ expect(helper.dropdown_max_select({ 'max-select'.to_sym => max + 5 }))
+ .to eq(max)
end
end
@@ -64,43 +41,19 @@ RSpec.describe FormHelper do
describe '#reviewers_dropdown_options' do
let(:merge_request) { build(:merge_request) }
- context "with the :limit_reviewer_and_assignee_size feature flag on" do
- context "with multiple reviewers" do
- it 'correctly returns the max amount of reviewers or assignees to allow' do
- allow(helper).to receive(:merge_request_supports_multiple_reviewers?).and_return(true)
-
- expect(helper.reviewers_dropdown_options(merge_request)[:data][:'max-select'])
- .to eq(Issuable::MAX_NUMBER_OF_ASSIGNEES_OR_REVIEWERS)
- end
- end
+ context "with multiple reviewers" do
+ it 'correctly returns the max amount of reviewers or assignees to allow' do
+ allow(helper).to receive(:merge_request_supports_multiple_reviewers?).and_return(true)
- context "with only 1 reviewer" do
- it 'correctly returns the max amount of reviewers or assignees to allow' do
- expect(helper.reviewers_dropdown_options(merge_request)[:data][:'max-select'])
- .to eq(1)
- end
+ expect(helper.reviewers_dropdown_options(merge_request)[:data][:'max-select'])
+ .to eq(Issuable::MAX_NUMBER_OF_ASSIGNEES_OR_REVIEWERS)
end
end
- context "with the :limit_reviewer_and_assignee_size feature flag off" do
- before do
- stub_feature_flags(limit_reviewer_and_assignee_size: false)
- end
-
- context "with multiple reviewers" do
- it 'correctly returns the max amount of reviewers or assignees to allow' do
- allow(helper).to receive(:merge_request_supports_multiple_reviewers?).and_return(true)
-
- expect(helper.reviewers_dropdown_options(merge_request)[:data][:'max-select'])
- .to eq(nil)
- end
- end
-
- context "with only 1 reviewer" do
- it 'correctly returns the max amount of reviewers or assignees to allow' do
- expect(helper.reviewers_dropdown_options(merge_request)[:data][:'max-select'])
- .to eq(1)
- end
+ context "with only 1 reviewer" do
+ it 'correctly returns the max amount of reviewers or assignees to allow' do
+ expect(helper.reviewers_dropdown_options(merge_request)[:data][:'max-select'])
+ .to eq(1)
end
end
end