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
bd4df3db
Commit
bd4df3db
authored
Nov 16, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make spec expectations more robust for creating an issue from a thread
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
c5e45556
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb
...atures/resolving_discussions_in_issues_shared_examples.rb
+12
-26
No files found.
spec/support/shared_examples/features/resolving_discussions_in_issues_shared_examples.rb
View file @
bd4df3db
# frozen_string_literal: true
RSpec
.
shared_examples
'creating an issue for a thread'
do
it
'shows an issue with the title filled in'
do
it
'shows an issue creation form'
do
# Title field is filled in
title_field
=
page
.
find_field
(
'issue[title]'
)
expect
(
title_field
.
value
).
to
include
(
merge_request
.
title
)
end
it
'has a mention of the discussion in the description'
do
description_field
=
page
.
find_field
(
'issue[description]'
)
# Has a hidden field for the merge request
merge_request_field
=
find
(
'#merge_request_to_resolve_discussions_of'
,
visible:
false
)
expect
(
merge_request_field
.
value
).
to
eq
(
merge_request
.
iid
.
to_s
)
# Has a mention of the discussion in the description
description_field
=
page
.
find_field
(
'issue[description]'
)
expect
(
description_field
.
value
).
to
include
(
discussion
.
first_note
.
note
)
end
it
'can create a new issue for the project'
do
it
'creates a new issue for the project'
do
# Actually creates an issue for the project
expect
{
click_button
'Create issue'
}.
to
change
{
project
.
issues
.
reload
.
size
}.
by
(
1
)
end
it
'resolves the discussion in the merge request'
do
click_button
'Create issue'
# Resolves the discussion in the merge request
discussion
.
first_note
.
reload
expect
(
discussion
.
resolved?
).
to
eq
(
true
)
end
it
'shows a flash messaage after resolving a discussion'
do
click_button
'Create issue'
page
.
within
'.flash-notice'
do
# Only check for the word 'Resolved' since the spec might have resolved
# multiple discussions
expect
(
page
).
to
have_content
(
'Resolved'
)
end
end
it
'has a hidden field for the merge request'
do
merge_request_field
=
find
(
'#merge_request_to_resolve_discussions_of'
,
visible:
false
)
expect
(
merge_request_field
.
value
).
to
eq
(
merge_request
.
iid
.
to_s
)
# Issue title inludes MR title
expect
(
page
).
to
have_content
(
%Q(Follow-up from "
#{
merge_request
.
title
}
")
)
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