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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
554baec9
Commit
554baec9
authored
Sep 06, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method
parent
81da7f13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
app/models/merge_request.rb
app/models/merge_request.rb
+7
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+13
-0
No files found.
app/models/merge_request.rb
View file @
554baec9
...
...
@@ -327,6 +327,13 @@ class MergeRequest < ActiveRecord::Base
!
source_project
.
forked_from?
(
target_project
)
end
def
can_reopen?
return
false
if
closed_without_fork?
||
closed_without_source_project?
return
true
if
closed?
# false
end
def
ensure_merge_request_diff
merge_request_diff
||
create_merge_request_diff
end
...
...
spec/models/merge_request_spec.rb
View file @
554baec9
...
...
@@ -1076,4 +1076,17 @@ describe MergeRequest, models: true do
end
end
end
describe
'#can_reopen?'
do
it
"returns true"
do
subject
.
close
binding
.
pry
expect
(
subject
.
can_reopen?
).
to
be_truthy
end
it
"returns false"
do
expect
(
subject
.
can_reopen?
).
to
be_falsey
end
end
end
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