summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-06-01 18:43:44 +0000
committerStan Hu <stanhu@gmail.com>2016-06-01 18:43:44 +0000
commite9bb895b5ac639bcb4166b23b796566f0320741a (patch)
tree2b5b590430bcf59061161ff3dce65982b2cbd44a
parent5a377d20d53a2b15229505c0f428f0d9b5925622 (diff)
parent30aa64202b073e33834241589595a58a14080107 (diff)
downloadgitlab-ce-e9bb895b5ac639bcb4166b23b796566f0320741a.tar.gz
Merge branch 'fix-note-validation-failure' into 'master'
Fix note validation spec failure Fix failing build due to project of note not matching issue project. See merge request !4415
-rw-r--r--spec/models/commit_range_spec.rb5
-rw-r--r--spec/models/note_spec.rb2
2 files changed, 4 insertions, 3 deletions
diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb
index 6bc496414a3..384a38ebc69 100644
--- a/spec/models/commit_range_spec.rb
+++ b/spec/models/commit_range_spec.rb
@@ -151,9 +151,10 @@ describe CommitRange, models: true do
issue = create(:issue)
create(:note_on_issue,
- noteable_id: issue.id,
+ noteable: issue,
system: true,
- note: commit1.revert_description)
+ note: commit1.revert_description,
+ project: issue.project)
expect_any_instance_of(Commit).to receive(:reverts_commit?).
with(commit1).
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index b25150f7055..e9d89c9a847 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -154,7 +154,7 @@ describe Note, models: true do
context "confidential issues" do
let(:user) { create :user }
let(:confidential_issue) { create(:issue, :confidential, author: user) }
- let(:confidential_note) { create :note, note: "Random", noteable: confidential_issue }
+ let(:confidential_note) { create :note, note: "Random", noteable: confidential_issue, project: confidential_issue.project }
it "returns notes with matching content if user can see the issue" do
expect(described_class.search(confidential_note.note, as_user: user)).to eq([confidential_note])