Commit 30aa6420 authored by Stan Hu's avatar Stan Hu

Fix note validation spec failures

parent 2d084dd8
...@@ -151,9 +151,10 @@ describe CommitRange, models: true do ...@@ -151,9 +151,10 @@ describe CommitRange, models: true do
issue = create(:issue) issue = create(:issue)
create(:note_on_issue, create(:note_on_issue,
noteable_id: issue.id, noteable: issue,
system: true, system: true,
note: commit1.revert_description) note: commit1.revert_description,
project: issue.project)
expect_any_instance_of(Commit).to receive(:reverts_commit?). expect_any_instance_of(Commit).to receive(:reverts_commit?).
with(commit1). with(commit1).
......
...@@ -154,7 +154,7 @@ describe Note, models: true do ...@@ -154,7 +154,7 @@ describe Note, models: true do
context "confidential issues" do context "confidential issues" do
let(:user) { create :user } let(:user) { create :user }
let(:confidential_issue) { create(:issue, :confidential, author: 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 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]) expect(described_class.search(confidential_note.note, as_user: user)).to eq([confidential_note])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment