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
path: root/spec
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2016-03-19 23:06:59 +0300
committerRémy Coutable <remy@rymai.me>2016-03-21 14:31:20 +0300
commit42c4304133299888b74800d8bb810a79a6ddb0eb (patch)
tree055c0707fbb80d79c083e5f363fa0ee29df3b4cb /spec
parente6961c4681cf561942cb459f28c1fad8854f61c9 (diff)
Merge branch 'remove-wip' into 'master'
Easily (un)mark merge request as WIP using link Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3768 and https://gitlab.com/gitlab-org/gitlab-ce/issues/3516 ## Link to add `WIP` prefix (underline is visible because of hover) ![wipless_title](/uploads/72a6f7119ba9d8043ca8329641e97c3b/wipless_title.png) ## Link to remove `WIP` prefix ![wip_title](/uploads/8620ad65da9ef620b180603520fead55/wip_title.png) ## System note after WIP is added ![wip_sysnote](/uploads/2de073b75e854d2c9e243eb8b5d5c259/wip_sysnote.png) ## Widget with link to remove WIP ![wip_widget](/uploads/cf83ea93743c4c26d9df759c17cb9d7b/wip_widget.png) ## Flash after WIP is removed ![wip_flash](/uploads/27b7240cd5d7ceeb8b7b477abd94d7ff/wip_flash.png) ## System note after WIP is removed ![wipless_sysnote](/uploads/c0d3368abdf21a2f253532a9a9594d90/wipless_sysnote.png) ## Widget when current user cannot remove the WIP prefix ![wip_widget_unauthorized](/uploads/174ccf1674be86dc81c3078fe297acb7/wip_widget_unauthorized.png) cc @creamzy See merge request !3006
Diffstat (limited to 'spec')
-rw-r--r--spec/models/merge_request_spec.rb28
1 files changed, 10 insertions, 18 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 2165cfb7a32..f2f07e4ee17 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -216,24 +216,11 @@ describe MergeRequest, models: true do
end
describe "#work_in_progress?" do
- it "detects the 'WIP ' prefix" do
- subject.title = "WIP #{subject.title}"
- expect(subject).to be_work_in_progress
- end
-
- it "detects the 'WIP: ' prefix" do
- subject.title = "WIP: #{subject.title}"
- expect(subject).to be_work_in_progress
- end
-
- it "detects the '[WIP] ' prefix" do
- subject.title = "[WIP] #{subject.title}"
- expect(subject).to be_work_in_progress
- end
-
- it "detects the '[WIP]' prefix" do
- subject.title = "[WIP]#{subject.title}"
- expect(subject).to be_work_in_progress
+ ['WIP ', 'WIP:', 'WIP: ', '[WIP]', '[WIP] ', ' [WIP] WIP [WIP] WIP: WIP '].each do |wip_prefix|
+ it "detects the '#{wip_prefix}' prefix" do
+ subject.title = "#{wip_prefix}#{subject.title}"
+ expect(subject).to be_work_in_progress
+ end
end
it "doesn't detect WIP for words starting with WIP" do
@@ -241,6 +228,11 @@ describe MergeRequest, models: true do
expect(subject).not_to be_work_in_progress
end
+ it "doesn't detect WIP for words containing with WIP" do
+ subject.title = "WupWipwap #{subject.title}"
+ expect(subject).not_to be_work_in_progress
+ end
+
it "doesn't detect WIP by default" do
expect(subject).not_to be_work_in_progress
end