Commit 6f356148 authored by Douwe Maan's avatar Douwe Maan

Fix mentionable specs

parent 7a0cc665
......@@ -89,9 +89,9 @@ eos
end
it_behaves_like 'a mentionable' do
subject { commit }
subject { create(:project).commit }
let(:author) { create(:user, email: commit.author_email) }
let(:author) { create(:user, email: subject.author_email) }
let(:backref_text) { "commit #{subject.id}" }
let(:set_mentionable_text) do
->(txt) { allow(subject).to receive(:safe_message).and_return(txt) }
......
......@@ -69,7 +69,7 @@ describe Issue do
end
it_behaves_like 'an editable mentionable' do
subject { create(:issue, project: project) }
subject { create(:issue) }
let(:backref_text) { "issue #{subject.to_reference}" }
let(:set_mentionable_text) { ->(txt){ subject.description = txt } }
......
......@@ -192,10 +192,9 @@ describe Note do
end
it_behaves_like 'an editable mentionable' do
subject { create :note, noteable: issue, project: project }
subject { create :note, noteable: issue, project: issue.project }
let(:project) { create(:project) }
let(:issue) { create :issue, project: project }
let(:issue) { create :issue }
let(:backref_text) { issue.gfm_reference }
let(:set_mentionable_text) { ->(txt) { subject.note = txt } }
end
......
......@@ -5,7 +5,7 @@
# - let(:set_mentionable_text) { lambda { |txt| "block that assigns txt to the subject's mentionable_text" } }
def common_mentionable_setup
let(:project) { create :project }
let(:project) { subject.project }
let(:author) { subject.author }
let(:mentioned_issue) { create(:issue, project: project) }
......
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