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
edfb5d7b
Commit
edfb5d7b
authored
7 years ago
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for AutoDevopsHelper
parent
c48ef9a0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
spec/helpers/auto_devops_helper_spec.rb
spec/helpers/auto_devops_helper_spec.rb
+59
-0
No files found.
spec/helpers/auto_devops_helper_spec.rb
0 → 100644
View file @
edfb5d7b
require
'spec_helper'
describe
AutoDevopsHelper
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
describe
'.show_auto_devops_callout?'
do
let
(
:allowed
)
{
true
}
before
do
allow
(
helper
).
to
receive
(
:can?
).
with
(
user
,
:admin_pipeline
,
project
)
{
allowed
}
allow
(
helper
).
to
receive
(
:current_user
)
{
user
}
end
subject
{
helper
.
show_auto_devops_callout?
(
project
)
}
context
'when all conditions are met'
do
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when dismissed'
do
before
do
helper
.
request
.
cookies
[
:auto_devops_settings_dismissed
]
=
'true'
end
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when user cannot admin project'
do
let
(
:allowed
)
{
false
}
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when auto devops is enabled system-wide'
do
before
do
stub_application_setting
(
auto_devops_enabled:
true
)
end
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when auto devops is explicitly enabled for project'
do
before
do
project
.
create_auto_devops!
(
enabled:
true
)
end
it
{
is_expected
.
to
eq
(
false
)
}
end
context
'when auto devops is explicitly disabled for project'
do
before
do
project
.
create_auto_devops!
(
enabled:
false
)
end
it
{
is_expected
.
to
eq
(
false
)
}
end
end
end
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