summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-24 12:46:39 +0000
committerDouwe Maan <douwe@gitlab.com>2015-04-24 12:46:39 +0000
commit6ae606d81f12d363e02c1dc0b5b9904d431a9a3a (patch)
tree02be1af7cca9197d076db2e926244c496fe72cd9 /spec/models/commit_spec.rb
parent9409f2a3b31178448c4f41802d2775ded9095800 (diff)
parent077a8ec270b58ed099d13447841d51b2df70541b (diff)
downloadgitlab-ce-6ae606d81f12d363e02c1dc0b5b9904d431a9a3a.tar.gz
Merge branch 'commit-project' into 'master'
Link cross-project cross-reference notes to correct project. - Fixes #1431: Don't crash when an MR from a fork has a cross-reference comment from the target project on of its commits. - Include commit comments in MR from a forked project. To accomplish this, the Commit model needs to know about its project. Adding this attribute also simplifies a bunch of other methods that deal with a note's target, that previously had to have special logic for when it belonged to a commit. See merge request !554
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 506bc3339b6..ad2ac143d97 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe Commit do
let(:project) { create :project }
- let(:commit) { project.repository.commit }
+ let(:commit) { project.commit }
describe '#title' do
it "returns no_commit_message when safe_message is blank" do
@@ -58,13 +58,13 @@ eos
it 'detects issues that this commit is marked as closing' do
commit.stub(safe_message: "Fixes ##{issue.iid}")
- expect(commit.closes_issues(project)).to eq([issue])
+ expect(commit.closes_issues).to eq([issue])
end
it 'does not detect issues from other projects' do
ext_ref = "#{other_project.path_with_namespace}##{other_issue.iid}"
commit.stub(safe_message: "Fixes #{ext_ref}")
- expect(commit.closes_issues(project)).to be_empty
+ expect(commit.closes_issues).to be_empty
end
end