Commit ea42b27c authored by Kev's avatar Kev

Add test for commit.reverting_commit

parent 59125300
......@@ -750,6 +750,30 @@ eos
end
end
describe '#reverting_commit' do
let(:user) { create(:user) }
let(:issue) { create(:issue, author: user, project: project) }
it 'returns true if the commit has been reverted' do
create(:note_on_issue,
noteable: issue,
system: true,
note: commit.revert_description(user),
project: issue.project)
reverting_commit = nil
expect_next_instance_of(Commit) do |revert_commit|
reverting_commit = revert_commit
expect(revert_commit).to receive(:reverts_commit?)
.with(commit, user)
.and_return(true)
end
expect(commit.reverting_commit(user, issue.notes_with_associations)).to eq(reverting_commit)
end
end
describe '#has_been_reverted?' do
let(:user) { create(:user) }
let(:issue) { create(:issue, author: user, 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