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/issuables_helper_spec.rb')
-rw-r--r--spec/helpers/issuables_helper_spec.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index 38ad11846d2..4c93a8387a9 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe IssuablesHelper do
+RSpec.describe IssuablesHelper do
let(:label) { build_stubbed(:label) }
let(:label2) { build_stubbed(:label) }
@@ -303,4 +303,28 @@ describe IssuablesHelper do
end
end
end
+
+ describe '#issuable_squash_option?' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:issuable_persisted, :squash, :squash_enabled_by_default, :expectation) do
+ true | true | true | true
+ true | false | true | false
+ false | false | false | false
+ false | false | true | true
+ false | true | false | false
+ false | true | true | true
+ end
+
+ with_them do
+ it 'returns the correct value' do
+ project = double(
+ squash_enabled_by_default?: squash_enabled_by_default
+ )
+ issuable = double(persisted?: issuable_persisted, squash: squash)
+
+ expect(helper.issuable_squash_option?(issuable, project)).to eq(expectation)
+ end
+ end
+ end
end