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
0e9b26d1
Commit
0e9b26d1
authored
Aug 31, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce duplication in RSS feed specs for filter_issues_spec
parent
98e6a150
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+24
-26
No files found.
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
0e9b26d1
...
...
@@ -538,34 +538,32 @@ describe 'Filter issues', js: true do
group
.
add_developer
(
user
)
end
it
'updates atom feed link for project issues'
do
visit
project_issues_path
(
project
,
milestone_title:
milestone
.
title
,
assignee_id:
user
.
id
)
link
=
find_link
(
'Subscribe'
)
params
=
CGI
.
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
auto_discovery_link
=
find
(
'link[type="application/atom+xml"]'
,
visible:
false
)
auto_discovery_params
=
CGI
.
parse
(
URI
.
parse
(
auto_discovery_link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'rss_token'
=>
[
user
.
rss_token
])
expect
(
params
).
to
include
(
'milestone_title'
=>
[
milestone
.
title
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
expect
(
auto_discovery_params
).
to
include
(
'rss_token'
=>
[
user
.
rss_token
])
expect
(
auto_discovery_params
).
to
include
(
'milestone_title'
=>
[
milestone
.
title
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
shared_examples
'updates atom feed link'
do
|
type
|
it
"for
#{
type
}
"
do
visit
path
link
=
find_link
(
'Subscribe'
)
params
=
CGI
.
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
auto_discovery_link
=
find
(
'link[type="application/atom+xml"]'
,
visible:
false
)
auto_discovery_params
=
CGI
.
parse
(
URI
.
parse
(
auto_discovery_link
[
:href
]).
query
)
expected
=
{
'rss_token'
=>
[
user
.
rss_token
],
'milestone_title'
=>
[
milestone
.
title
],
'assignee_id'
=>
[
user
.
id
.
to_s
]
}
expect
(
params
).
to
include
(
expected
)
expect
(
auto_discovery_params
).
to
include
(
expected
)
end
end
it_behaves_like
'updates atom feed link'
,
:project
do
let
(
:path
)
{
project_issues_path
(
project
,
milestone_title:
milestone
.
title
,
assignee_id:
user
.
id
)
}
end
it
'updates atom feed link for group issues'
do
visit
issues_group_path
(
group
,
milestone_title:
milestone
.
title
,
assignee_id:
user
.
id
)
link
=
find
(
'.breadcrumbs a'
,
text:
'Subscribe'
)
params
=
CGI
.
parse
(
URI
.
parse
(
link
[
:href
]).
query
)
auto_discovery_link
=
find
(
'link[type="application/atom+xml"]'
,
visible:
false
)
auto_discovery_params
=
CGI
.
parse
(
URI
.
parse
(
auto_discovery_link
[
:href
]).
query
)
expect
(
params
).
to
include
(
'rss_token'
=>
[
user
.
rss_token
])
expect
(
params
).
to
include
(
'milestone_title'
=>
[
milestone
.
title
])
expect
(
params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
expect
(
auto_discovery_params
).
to
include
(
'rss_token'
=>
[
user
.
rss_token
])
expect
(
auto_discovery_params
).
to
include
(
'milestone_title'
=>
[
milestone
.
title
])
expect
(
auto_discovery_params
).
to
include
(
'assignee_id'
=>
[
user
.
id
.
to_s
])
it_behaves_like
'updates atom feed link'
,
:group
do
let
(
:path
)
{
issues_group_path
(
group
,
milestone_title:
milestone
.
title
,
assignee_id:
user
.
id
)
}
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