Commit bf7a1c02 authored by Kev's avatar Kev

Improve reverting_commit test

parent dc6a0ec1
......@@ -754,23 +754,20 @@ eos
let(:user) { create(:user) }
let(:issue) { create(:issue, author: user, project: project) }
it 'returns true if the commit has been reverted' do
it 'returns the reverting commit' 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)
expect(commit.reverting_commit(user, issue.notes_with_associations)).to eq(commit)
end
end
......
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