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
e04eb30a
Commit
e04eb30a
authored
Jan 27, 2022
by
Caleb Cooper
Committed by
Rémy Coutable
Jan 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add view tests to pipeline subscriptions view
parent
622a28c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
ee/spec/views/projects/settings/subscriptions/_index.html.haml_spec.rb
.../projects/settings/subscriptions/_index.html.haml_spec.rb
+39
-0
No files found.
ee/spec/views/projects/settings/subscriptions/_index.html.haml_spec.rb
0 → 100644
View file @
e04eb30a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'projects/settings/subscriptions/_index.html.haml'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let_it_be
(
:upstream_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let_it_be
(
:downstream_project
)
{
create
(
:project
,
:public
,
:repository
,
upstream_projects:
[
project
])
}
before
do
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
assign
(
:project
,
project
)
end
it
'has a help link'
do
render
expect
(
rendered
).
to
have_css
(
"a[href^='/help'][href$='#trigger-a-pipeline-when-an-upstream-project-is-rebuilt']"
)
end
context
'when project has upstream subscription'
do
before
do
assign
(
:project
,
downstream_project
)
end
it
'has delete button'
do
render
expect
(
rendered
).
to
have_selector
(
'[data-testid="delete-subscription"].btn-danger'
)
end
end
context
'when project has downstream subscription'
do
it
'has no delete button'
do
render
expect
(
rendered
).
not_to
have_content
(
'No project subscribes to the pipelines in this project.'
)
expect
(
rendered
).
not_to
have_selector
(
'[data-testid="delete-subscription"].btn-danger'
)
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