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
Jérome Perrin
gitlab-ce
Commits
ab520862
Commit
ab520862
authored
Mar 09, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show correct message when user cannot resolve discussions
parent
40dd9937
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
79 deletions
+114
-79
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+5
-2
spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb
...ues/create_issue_for_discussions_in_merge_request_spec.rb
+58
-44
spec/features/issues/create_issue_for_single_discussion_in_merge_request.rb
...es/create_issue_for_single_discussion_in_merge_request.rb
+51
-33
No files found.
app/views/shared/issuable/_form.html.haml
View file @
ab520862
...
@@ -58,9 +58,12 @@
...
@@ -58,9 +58,12 @@
Creating this issue will resolve all discussions in
Creating this issue will resolve all discussions in
=
link_to_discussions_to_resolve
(
@merge_request_for_resolving_discussions
,
@discussion_to_resolve
)
=
link_to_discussions_to_resolve
(
@merge_request_for_resolving_discussions
,
@discussion_to_resolve
)
-
else
-
else
The discussion at
The
=
@discussion_to_resolve
?
'discussion'
:
'discussions'
at
=
link_to_discussions_to_resolve
(
@merge_request_for_resolving_discussions
,
@discussion_to_resolve
)
=
link_to_discussions_to_resolve
(
@merge_request_for_resolving_discussions
,
@discussion_to_resolve
)
will stay unresolved. Ask someone with permission to resolve it.
will stay unresolved. Ask someone with permission to resolve
=
@discussion_to_resolve
?
'it.'
:
'them.'
-
is_footer
=
!
(
issuable
.
is_a?
(
MergeRequest
)
&&
issuable
.
new_record?
)
-
is_footer
=
!
(
issuable
.
is_a?
(
MergeRequest
)
&&
issuable
.
new_record?
)
.row-content-block
{
class:
(
is_footer
?
"footer-block"
:
"middle-block"
)
}
.row-content-block
{
class:
(
is_footer
?
"footer-block"
:
"middle-block"
)
}
...
...
spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb
View file @
ab520862
...
@@ -6,6 +6,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
...
@@ -6,6 +6,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let!
(
:discussion
)
{
Discussion
.
for_diff_notes
([
create
(
:diff_note_on_merge_request
,
noteable:
merge_request
,
project:
project
)]).
first
}
let!
(
:discussion
)
{
Discussion
.
for_diff_notes
([
create
(
:diff_note_on_merge_request
,
noteable:
merge_request
,
project:
project
)]).
first
}
describe
'as a user with access to the project'
do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_as
user
login_as
user
...
@@ -76,4 +77,17 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
...
@@ -76,4 +77,17 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
end
end
end
end
end
end
end
describe
'as a reporter'
do
before
do
project
.
team
<<
[
user
,
:reporter
]
login_as
user
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
,
merge_request_for_resolving_discussions:
merge_request
.
iid
)
end
it
'Shows a notice to ask someone else to resolve the discussions'
do
expect
(
page
).
to
have_content
(
"The discussions at
#{
merge_request
.
to_reference
}
will stay unresolved. Ask someone with permission to resolve them."
)
end
end
end
end
spec/features/issues/create_issue_for_single_discussion_in_merge_request.rb
View file @
ab520862
...
@@ -6,6 +6,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
...
@@ -6,6 +6,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
let!
(
:discussion
)
{
Discussion
.
for_diff_notes
([
create
(
:diff_note_on_merge_request
,
noteable:
merge_request
,
project:
project
)]).
first
}
let!
(
:discussion
)
{
Discussion
.
for_diff_notes
([
create
(
:diff_note_on_merge_request
,
noteable:
merge_request
,
project:
project
)]).
first
}
describe
'As a user with access to the project'
do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_as
user
login_as
user
...
@@ -60,4 +61,21 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
...
@@ -60,4 +61,21 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
it_behaves_like
'creating an issue for a discussion'
it_behaves_like
'creating an issue for a discussion'
end
end
end
describe
'as a reporter'
do
before
do
project
.
team
<<
[
user
,
:reporter
]
login_as
user
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
,
merge_request_for_resolving_discussions:
merge_request
.
iid
,
discussion_to_resolve:
discussion
.
id
)
end
it
'Shows a notice to ask someone else to resolve the discussions'
do
expect
(
page
).
to
have_content
(
"The discussion at
#{
merge_request
.
to_reference
}
"
\
"(discussion
#{
discussion
.
first_note
.
id
}
) will stay unresolved."
\
"Ask someone with permission to resolve it."
)
end
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