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
f0ec5704
Commit
f0ec5704
authored
Dec 20, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for pipeline quotas page
parent
5cdb5c87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
spec/features/groups/pipeline_quota.rb
spec/features/groups/pipeline_quota.rb
+71
-0
No files found.
spec/features/groups/pipeline_quota.rb
0 → 100644
View file @
f0ec5704
require
'spec_helper'
feature
'Groups > Pipeline Quota'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
true
)
}
before
do
group
.
add_owner
(
user
)
login_with
(
user
)
end
context
'with no quota'
do
let
(
:group
)
{
create
(
:group
,
:with_build_minutes
)
}
it
'shows correct ratio and status'
do
visit_pipeline_quota_page
page
.
within
(
'.pipeline-quota'
)
do
expect
(
page
).
to
have_content
(
"400 / Unlimited minutes"
)
expect
(
page
).
to
have_selector
(
'.progress-bar-success'
)
end
end
end
context
'with no projects using shared runners'
do
let
(
:group
)
{
create
(
:group
,
:with_not_used_build_minutes_limit
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
false
)
}
it
'shows correct ratio and status'
do
visit_pipeline_quota_page
page
.
within
(
'.pipeline-quota'
)
do
expect
(
page
).
to
have_content
(
"300 / Unlimited minutes"
)
expect
(
page
).
to
have_selector
(
'.progress-bar-success'
)
end
end
end
context
'minutes under quota'
do
let
(
:group
)
{
create
(
:group
,
:with_not_used_build_minutes_limit
)
}
it
'shows correct ratio and status'
do
visit_pipeline_quota_page
page
.
within
(
'.pipeline-quota'
)
do
expect
(
page
).
to
have_content
(
"300 / 500 minutes"
)
expect
(
page
).
to
have_content
(
"60% used"
)
expect
(
page
).
to
have_selector
(
'.progress-bar-success'
)
end
end
end
context
'minutes over quota'
do
let
(
:group
)
{
create
(
:group
,
:with_used_build_minutes_limit
)
}
it
'shows correct ratio and status'
do
visit_pipeline_quota_page
page
.
within
(
'.pipeline-quota'
)
do
expect
(
page
).
to
have_content
(
"1000 / 500 minutes"
)
expect
(
page
).
to
have_content
(
"200% used"
)
expect
(
page
).
to
have_selector
(
'.progress-bar-danger'
)
end
end
end
def
visit_pipeline_quota_page
visit
group_pipeline_quota_path
(
group
)
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