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
6b02c82c
Commit
6b02c82c
authored
Aug 10, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve grammar
parent
2e08f115
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
16 deletions
+17
-16
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+1
-1
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-1
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+2
-2
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+7
-7
spec/views/projects/merge_requests/edit.html.haml_spec.rb
spec/views/projects/merge_requests/edit.html.haml_spec.rb
+2
-2
spec/views/projects/merge_requests/show.html.haml_spec.rb
spec/views/projects/merge_requests/show.html.haml_spec.rb
+4
-3
No files found.
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
6b02c82c
-
if
@merge_request
.
closed_without_fork?
-
if
@merge_request
.
closed_without_fork?
.alert.alert-danger
.alert.alert-danger
%p
Source project is not a fork of the target project
%p
The source project of this merge request has been removed.
.clearfix.detail-page-header
.clearfix.detail-page-header
.issuable-header
.issuable-header
...
...
app/views/shared/issuable/_form.html.haml
View file @
6b02c82c
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
title:
'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.'
}
title:
'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.'
}
=
icon
(
'question-circle'
)
=
icon
(
'question-circle'
)
-
if
issuable
.
is_a?
(
MergeRequest
)
&&
!
@merge_request
.
closed_without_fork?
-
if
issuable
.
is_a?
(
MergeRequest
)
&&
!
issuable
.
closed_without_fork?
%hr
%hr
-
if
@merge_request
.
new_record?
-
if
@merge_request
.
new_record?
.form-group
.form-group
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
6b02c82c
...
@@ -171,7 +171,7 @@ describe Projects::MergeRequestsController do
...
@@ -171,7 +171,7 @@ describe Projects::MergeRequestsController do
expect
(
merge_request
.
reload
.
closed?
).
to
be_truthy
expect
(
merge_request
.
reload
.
closed?
).
to
be_truthy
end
end
it
'allow
to edit closed MR
'
do
it
'allow
s editing of a closed merge request
'
do
merge_request
.
close!
merge_request
.
close!
put
:update
,
put
:update
,
...
@@ -186,7 +186,7 @@ describe Projects::MergeRequestsController do
...
@@ -186,7 +186,7 @@ describe Projects::MergeRequestsController do
expect
(
merge_request
.
reload
.
title
).
to
eq
'New title'
expect
(
merge_request
.
reload
.
title
).
to
eq
'New title'
end
end
it
'does not allow to update target branch closed
MR
'
do
it
'does not allow to update target branch closed
merge request
'
do
merge_request
.
close!
merge_request
.
close!
put
:update
,
put
:update
,
...
...
spec/models/merge_request_spec.rb
View file @
6b02c82c
...
@@ -969,7 +969,7 @@ describe MergeRequest, models: true do
...
@@ -969,7 +969,7 @@ describe MergeRequest, models: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:unlink_project
)
{
Projects
::
UnlinkForkService
.
new
(
fork_project
,
user
)
}
let
(
:unlink_project
)
{
Projects
::
UnlinkForkService
.
new
(
fork_project
,
user
)
}
context
"when fork exists"
do
context
"when
the
fork exists"
do
let
(
:merge_request
)
do
let
(
:merge_request
)
do
create
(
:merge_request
,
create
(
:merge_request
,
source_project:
fork_project
,
source_project:
fork_project
,
...
@@ -979,13 +979,13 @@ describe MergeRequest, models: true do
...
@@ -979,13 +979,13 @@ describe MergeRequest, models: true do
it
{
expect
(
merge_request
.
fork_missing?
).
to
be_falsey
}
it
{
expect
(
merge_request
.
fork_missing?
).
to
be_falsey
}
end
end
context
"when
source project i
s the target project"
do
context
"when
the source project is the same a
s the target project"
do
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
it
{
expect
(
merge_request
.
fork_missing?
).
to
be_falsey
}
it
{
expect
(
merge_request
.
fork_missing?
).
to
be_falsey
}
end
end
context
"when fork does not exist"
do
context
"when
the
fork does not exist"
do
let
(
:merge_request
)
do
let
(
:merge_request
)
do
create
(
:merge_request
,
create
(
:merge_request
,
source_project:
fork_project
,
source_project:
fork_project
,
...
@@ -1007,18 +1007,18 @@ describe MergeRequest, models: true do
...
@@ -1007,18 +1007,18 @@ describe MergeRequest, models: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:unlink_project
)
{
Projects
::
UnlinkForkService
.
new
(
fork_project
,
user
)
}
let
(
:unlink_project
)
{
Projects
::
UnlinkForkService
.
new
(
fork_project
,
user
)
}
context
"when merge request is closed"
do
context
"when
the
merge request is closed"
do
let
(
:closed_merge_request
)
do
let
(
:closed_merge_request
)
do
create
(
:closed_merge_request
,
create
(
:closed_merge_request
,
source_project:
fork_project
,
source_project:
fork_project
,
target_project:
project
)
target_project:
project
)
end
end
it
"returns false if fork exist"
do
it
"returns false if
the
fork exist"
do
expect
(
closed_merge_request
.
closed_without_fork?
).
to
be_falsey
expect
(
closed_merge_request
.
closed_without_fork?
).
to
be_falsey
end
end
it
"returns true if
fork doesn'
t exist"
do
it
"returns true if
the fork does no
t exist"
do
unlink_project
.
execute
unlink_project
.
execute
closed_merge_request
.
reload
closed_merge_request
.
reload
...
@@ -1026,7 +1026,7 @@ describe MergeRequest, models: true do
...
@@ -1026,7 +1026,7 @@ describe MergeRequest, models: true do
end
end
end
end
context
"when merge request is open"
do
context
"when
the
merge request is open"
do
let
(
:open_merge_request
)
do
let
(
:open_merge_request
)
do
create
(
:merge_request
,
create
(
:merge_request
,
source_project:
fork_project
,
source_project:
fork_project
,
...
...
spec/views/projects/merge_requests/edit.html.haml_spec.rb
View file @
6b02c82c
...
@@ -24,7 +24,7 @@ describe 'projects/merge_requests/edit.html.haml' do
...
@@ -24,7 +24,7 @@ describe 'projects/merge_requests/edit.html.haml' do
.
and_return
(
User
.
find
(
closed_merge_request
.
author_id
))
.
and_return
(
User
.
find
(
closed_merge_request
.
author_id
))
end
end
context
'when
closed
merge request without fork'
do
context
'when
a
merge request without fork'
do
it
"shows editable fields"
do
it
"shows editable fields"
do
unlink_project
.
execute
unlink_project
.
execute
closed_merge_request
.
reload
closed_merge_request
.
reload
...
@@ -39,7 +39,7 @@ describe 'projects/merge_requests/edit.html.haml' do
...
@@ -39,7 +39,7 @@ describe 'projects/merge_requests/edit.html.haml' do
end
end
end
end
context
'when
closed merge request with fork
'
do
context
'when
a merge request with an existing source project is closed
'
do
it
"shows editable fields"
do
it
"shows editable fields"
do
render
render
...
...
spec/views/projects/merge_requests/show.html.haml_spec.rb
View file @
6b02c82c
...
@@ -22,16 +22,17 @@ describe 'projects/merge_requests/show.html.haml' do
...
@@ -22,16 +22,17 @@ describe 'projects/merge_requests/show.html.haml' do
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
end
end
context
'when merge request is closed'
do
context
'when
the
merge request is closed'
do
it
'shows
Reopen
button'
do
it
'shows
the "Reopen"
button'
do
render
render
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
true
,
text:
'Reopen'
)
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
true
,
text:
'Reopen'
)
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
false
,
text:
'Close'
)
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
false
,
text:
'Close'
)
end
end
it
'does not show
Reopen button without fork
'
do
it
'does not show
the "Reopen" button when the source project does not exist
'
do
fork_project
.
destroy
fork_project
.
destroy
render
render
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
false
,
text:
'Reopen'
)
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
false
,
text:
'Reopen'
)
...
...
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