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
90741eea
Commit
90741eea
authored
Dec 19, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add feature tests for CI limit warnings
parent
a0b99f45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
spec/features/ci_shared_runner_limits_spec.rb
spec/features/ci_shared_runner_limits_spec.rb
+63
-0
No files found.
spec/features/ci_shared_runner_limits_spec.rb
0 → 100644
View file @
90741eea
require
'spec_helper'
feature
'CI shared runner limits'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
before
do
login_as
(
user
)
end
context
'with project'
do
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
shared_runners_enabled:
true
)
}
let
(
:namespace
)
{
create
(
:namespace
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
end
context
'without limit'
do
scenario
'it does not display a warning message on project homepage'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect_no_quota_exceeded_alert
end
end
context
'when limit is defined'
do
context
'when limit is exceeded'
do
let
(
:namespace
)
{
create
(
:namespace
,
:with_used_build_minutes_limit
)
}
scenario
'it displays a warning message on project homepage'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect_quota_exceeded_alert
(
'You have exceeded your build minutes quota.'
)
end
end
context
'when limit not yet exceeded'
do
let
(
:namespace
)
{
create
(
:namespace
,
:with_not_used_build_minutes_limit
)
}
scenario
'it does not display a warning message on project homepage'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect_no_quota_exceeded_alert
end
end
context
'when minutes are not yet set'
do
let
(
:namespace
)
{
create
(
:namespace
,
:with_build_minutes_limit
)
}
scenario
'it does not display a warning message on project homepage'
do
visit
namespace_project_path
(
project
.
namespace
,
project
)
expect_no_quota_exceeded_alert
end
end
end
end
def
expect_quota_exceeded_alert
(
message
=
nil
)
expect
(
page
).
to
have_selector
(
'.shared-runner-quota-message'
,
count:
1
)
expect
(
page
.
find
(
'.shared-runner-quota-message'
)).
to
have_content
(
message
)
unless
message
.
nil?
end
def
expect_no_quota_exceeded_alert
expect
(
page
).
not_to
have_selector
(
'.shared-runner-quota-message'
)
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