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
f5c8bfea
Commit
f5c8bfea
authored
May 09, 2018
by
blackst0ne
Committed by
Robert Speicher
May 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the `project/issues/references.feature` spinach test with an rspec analog
parent
f4c36fac
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
272 additions
and
61 deletions
+272
-61
changelogs/unreleased/blackst0ne-replace-spinach-project-issues-references-feature.yml
...0ne-replace-spinach-project-issues-references-feature.yml
+5
-0
features/project/issues/references.feature
features/project/issues/references.feature
+0
-33
features/steps/shared/issuable.rb
features/steps/shared/issuable.rb
+0
-28
spec/features/issuables/markdown_references/internal_references_spec.rb
...issuables/markdown_references/internal_references_spec.rb
+80
-0
spec/features/issuables/markdown_references/jira_spec.rb
spec/features/issuables/markdown_references/jira_spec.rb
+187
-0
No files found.
changelogs/unreleased/blackst0ne-replace-spinach-project-issues-references-feature.yml
0 → 100644
View file @
f5c8bfea
---
title
:
'
Replace
the
`project/issues/references.feature`
spinach
test
with
an
rspec
analog'
merge_request
:
18769
author
:
'
@blackst0ne'
type
:
other
features/project/issues/references.feature
deleted
100644 → 0
View file @
f4c36fac
@project_issues
Feature
:
Project Issues References
Background
:
Given
I sign in as
"John Doe"
And
public project
"Community"
And
"John Doe"
owns public project
"Community"
And
project
"Community"
has
"Community issue"
open issue
And
I logout
And
I sign in as
"Mary Jane"
And
private project
"Enterprise"
And
"Mary Jane"
owns private project
"Enterprise"
And
project
"Enterprise"
has
"Enterprise issue"
open issue
And
project
"Enterprise"
has
"Enterprise fix"
open merge request
And
I visit issue page
"Enterprise issue"
And
I leave a comment referencing issue
"Community issue"
And
I visit merge request page
"Enterprise fix"
And
I leave a comment referencing issue
"Community issue"
And
I logout
@javascript
Scenario
:
Viewing the public issue as a "John Doe"
Given
I sign in as
"John Doe"
When
I visit issue page
"Community issue"
Then
I should not see any related merge requests
And
I should see no notes at all
@javascript
Scenario
:
Viewing the public issue as "Mary Jane"
Given
I sign in as
"Mary Jane"
When
I visit issue page
"Community issue"
Then
I should see the
"Enterprise fix"
related merge request
And
I should see a note linking to
"Enterprise fix"
merge request
And
I should see a note linking to
"Enterprise issue"
issue
features/steps/shared/issuable.rb
View file @
f5c8bfea
...
...
@@ -5,13 +5,6 @@ module SharedIssuable
find
(
'.js-issuable-edit'
,
visible:
true
).
click
end
step
'project "Community" has "Community issue" open issue'
do
create_issuable_for_project
(
project_name:
'Community'
,
title:
'Community issue'
)
end
step
'project "Community" has "Community fix" open merge request'
do
create_issuable_for_project
(
project_name:
'Community'
,
...
...
@@ -59,32 +52,11 @@ module SharedIssuable
visit
project_merge_request_path
(
mr
.
target_project
,
mr
)
end
step
'I visit issue page "Community issue"'
do
issue
=
Issue
.
find_by
(
title:
'Community issue'
)
visit
project_issue_path
(
issue
.
project
,
issue
)
end
step
'I visit issue page "Community fix"'
do
mr
=
MergeRequest
.
find_by
(
title:
'Community fix'
)
visit
project_merge_request_path
(
mr
.
target_project
,
mr
)
end
step
'I should not see any related merge requests'
do
page
.
within
'.issue-details'
do
expect
(
page
).
not_to
have_content
(
'#merge-requests .merge-requests-title'
)
end
end
step
'I should see the "Enterprise fix" related merge request'
do
page
.
within
'#merge-requests .merge-requests-title'
do
expect
(
page
).
to
have_content
(
'1 Related Merge Request'
)
end
page
.
within
'#merge-requests ul'
do
expect
(
page
).
to
have_content
(
'Enterprise fix'
)
end
end
step
'I should see a note linking to "Enterprise fix" merge request'
do
visible_note
(
issuable:
MergeRequest
.
find_by
(
title:
'Enterprise fix'
),
...
...
spec/features/issuables/markdown_references/internal_references_spec.rb
0 → 100644
View file @
f5c8bfea
require
"rails_helper"
describe
"Internal references"
,
:js
do
include
Spec
::
Support
::
Helpers
::
Features
::
NotesHelpers
let
(
:private_project_user
)
{
private_project
.
owner
}
let
(
:private_project
)
{
create
(
:project
,
:private
,
:repository
)
}
let
(
:private_project_issue
)
{
create
(
:issue
,
project:
private_project
)
}
let
(
:private_project_merge_request
)
{
create
(
:merge_request
,
source_project:
private_project
)
}
let
(
:public_project_user
)
{
public_project
.
owner
}
let
(
:public_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:public_project_issue
)
{
create
(
:issue
,
project:
public_project
)
}
context
"when referencing to open issue"
do
context
"from private project"
do
context
"from issue"
do
before
do
sign_in
(
private_project_user
)
visit
(
project_issue_path
(
private_project
,
private_project_issue
))
add_note
(
"#
#{
public_project_issue
.
to_reference
(
private_project
)
}
"
)
end
context
"when user doesn't have access to private project"
do
before
do
sign_in
(
public_project_user
)
visit
(
project_issue_path
(
public_project
,
public_project_issue
))
end
it
{
expect
(
page
).
not_to
have_css
(
".note"
)
}
end
end
context
"from merge request"
do
before
do
sign_in
(
private_project_user
)
visit
(
project_merge_request_path
(
private_project
,
private_project_merge_request
))
add_note
(
"#
#{
public_project_issue
.
to_reference
(
private_project
)
}
"
)
end
context
"when user doesn't have access to private project"
do
before
do
sign_in
(
public_project_user
)
visit
(
project_issue_path
(
public_project
,
public_project_issue
))
end
it
"doesn't show any references"
do
page
.
within
(
".issue-details"
)
do
expect
(
page
).
not_to
have_content
(
"#merge-requests .merge-requests-title"
)
end
end
end
context
"when user has access to private project"
do
before
do
visit
(
project_issue_path
(
public_project
,
public_project_issue
))
end
it
"shows references"
do
page
.
within
(
"#merge-requests .merge-requests-title"
)
do
expect
(
page
).
to
have_content
(
"1 Related Merge Request"
)
end
page
.
within
(
"#merge-requests ul"
)
do
expect
(
page
).
to
have_content
(
private_project_merge_request
.
title
)
end
expect
(
page
).
to
have_content
(
"mentioned in merge request
#{
private_project_merge_request
.
to_reference
(
public_project
)
}
"
)
.
and
have_content
(
private_project_user
.
name
)
end
end
end
end
end
end
spec/features/issuables/markdown_references_spec.rb
→
spec/features/issuables/markdown_references
/jira
_spec.rb
View file @
f5c8bfea
This diff is collapsed.
Click to expand it.
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