summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-22 21:06:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-22 21:06:19 +0000
commit69a23cbee136eda0ab37874399421e6865cfc76b (patch)
treea6c94293a789bb2bdcbd6d8caf7a79dbac2ebee0 /spec/helpers
parentea4762d464bb36f3e36e318db47086e41f493377 (diff)
downloadgitlab-ce-69a23cbee136eda0ab37874399421e6865cfc76b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/merge_requests_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/helpers/merge_requests_helper_spec.rb b/spec/helpers/merge_requests_helper_spec.rb
index 695d1520897..6bd567eab57 100644
--- a/spec/helpers/merge_requests_helper_spec.rb
+++ b/spec/helpers/merge_requests_helper_spec.rb
@@ -26,6 +26,31 @@ describe MergeRequestsHelper do
end
end
+ describe '#state_name_with_icon' do
+ using RSpec::Parameterized::TableSyntax
+
+ let(:merge_request) { MergeRequest.new }
+
+ where(:state, :expected_name, :expected_icon) do
+ :merged? | 'Merged' | 'git-merge'
+ :closed? | 'Closed' | 'close'
+ :opened? | 'Open' | 'issue-open-m'
+ end
+
+ with_them do
+ before do
+ allow(merge_request).to receive(state).and_return(true)
+ end
+
+ it 'returns name and icon' do
+ name, icon = helper.state_name_with_icon(merge_request)
+
+ expect(name).to eq(expected_name)
+ expect(icon).to eq(expected_icon)
+ end
+ end
+ end
+
describe '#format_mr_branch_names' do
describe 'within the same project' do
let(:merge_request) { create(:merge_request) }