Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ea42b27c
Commit
ea42b27c
authored
Oct 18, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for commit.reverting_commit
parent
59125300
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+24
-0
No files found.
spec/models/commit_spec.rb
View file @
ea42b27c
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment