diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-24 17:26:23 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-05-04 20:03:47 +0100 |
commit | 29519edb55f17d0e7de5dfb289085c894b4d2826 (patch) | |
tree | 65377c9c9a98f36bfe07f564b4731380fe063452 /spec/lib/gitlab/cycle_analytics/events_spec.rb | |
parent | 020295fffc2329b7852c2739082986fd6b569d9e (diff) | |
download | gitlab-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/gitlab/cycle_analytics/events_spec.rb')
-rw-r--r-- | spec/lib/gitlab/cycle_analytics/events_spec.rb | 4 |
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 |