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:
authorPeter Leitzen <pl@neopoly.de>2018-07-23 21:27:44 +0300
committerPeter Leitzen <pl@neopoly.de>2018-08-10 17:45:11 +0300
commitd331377af5e2a8aae9db365b8a4892ad027dcfa7 (patch)
tree7c1812e1ce281e2abb476ab149cc638b008e64bb /spec/services/quick_actions
parent591fc8f57f6c9242d291ffc059124d7a0f2d21b8 (diff)
Show optional tag message in quick action explanation
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb32
1 files changed, 28 insertions, 4 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index e83648d5111..be209c41c0f 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -1356,12 +1356,36 @@ describe QuickActions::InterpretService do
end
describe 'tag a commit' do
- let(:content) { '/tag 1.2.3 some message' }
+ describe 'with a tag name' do
+ context 'without a message' do
+ let(:content) { '/tag v1.2.3' }
- it 'includes the tag name' do
- _, explanations = service.explain(content, commit)
+ it 'includes the tag name only' do
+ _, explanations = service.explain(content, commit)
- expect(explanations).to eq(["Tags this commit to 1.2.3."])
+ expect(explanations).to eq(["Tags this commit to v1.2.3."])
+ end
+ end
+
+ context 'with an empty message' do
+ let(:content) { '/tag v1.2.3 ' }
+
+ it 'includes the tag name only' do
+ _, explanations = service.explain(content, commit)
+
+ expect(explanations).to eq(["Tags this commit to v1.2.3."])
+ end
+ end
+ end
+
+ describe 'with a tag name and message' do
+ let(:content) { '/tag v1.2.3 Stable release' }
+
+ it 'includes the tag name and message' do
+ _, explanations = service.explain(content, commit)
+
+ expect(explanations).to eq(["Tags this commit to v1.2.3 with \"Stable release\"."])
+ end
end
end
end