summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2017-04-24 17:26:23 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-05-04 20:03:47 +0100
commit29519edb55f17d0e7de5dfb289085c894b4d2826 (patch)
tree65377c9c9a98f36bfe07f564b4731380fe063452 /spec/lib
parent020295fffc2329b7852c2739082986fd6b569d9e (diff)
downloadgitlab-ce-29519edb55f17d0e7de5dfb289085c894b4d2826.tar.gz
Cycle analytics specs needed Commit to reference issue28359-skip-process-commit-worker-unless-issues-referenced
The plan stage both measures time taken and lists related commits. We test for commits being listed, so needed to actually mention the issue in them. An alternative would have been adding “allow_any_instance_of(Commit).to receive(:matches_cross_reference_regex?).and_return(true)” but this felt too coupled to implementation.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/cycle_analytics/events_spec.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb
index 9d2ba481919..0d56bdd0ebd 100644
--- a/spec/lib/gitlab/cycle_analytics/events_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb
@@ -11,8 +11,6 @@ describe 'cycle analytics events' do
end
before do
- allow_any_instance_of(Gitlab::ReferenceExtractor).to receive(:issues).and_return([context])
-
setup(context)
end
@@ -332,7 +330,7 @@ describe 'cycle analytics events' do
def setup(context)
milestone = create(:milestone, project: project)
context.update(milestone: milestone)
- mr = create_merge_request_closing_issue(context)
+ mr = create_merge_request_closing_issue(context, commit_message: "References #{context.to_reference}")
ProcessCommitWorker.new.perform(project.id, user.id, mr.commits.last.to_hash)
end