Commit 6da02525 authored by Gary Holtz's avatar Gary Holtz

Adding some additional specs

parent 7abd7d2d
......@@ -109,14 +109,31 @@ RSpec.describe Note do
describe 'callbacks' do
describe '#keep_around_commit' do
it 'skips #keep_around_commit if `skip_keep_around_commits` is true ' do
noteable = create(:issue)
let!(:noteable) { create(:issue) }
it "calls #keep_around_commit normally" do
note = build(:note, project: noteable.project, noteable: noteable)
expect(note).to receive(:keep_around_commit)
note.save!
end
it "skips #keep_around_commit if 'skip_keep_around_commits' is true" do
note = build(:note, project: noteable.project, noteable: noteable, skip_keep_around_commits: true)
expect(note).not_to receive(:keep_around_commit)
note.save!
end
it "skips #keep_around_commit if 'importing' is true" do
note = build(:note, project: noteable.project, noteable: noteable, importing: true)
expect(note).not_to receive(:keep_around_commit)
note.save!
end
end
describe '#notify_after_create' do
......
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