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
Kazuhiko Shiozaki
gitlab-ce
Commits
4fda9ef8
Commit
4fda9ef8
authored
Nov 05, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
b18671a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
spec/factories/ci/projects.rb
spec/factories/ci/projects.rb
+2
-0
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+25
-3
spec/services/ci/register_build_service_spec.rb
spec/services/ci/register_build_service_spec.rb
+4
-0
No files found.
spec/factories/ci/projects.rb
View file @
4fda9ef8
...
@@ -33,6 +33,8 @@ FactoryGirl.define do
...
@@ -33,6 +33,8 @@ FactoryGirl.define do
gl_project
factory: :empty_project
gl_project
factory: :empty_project
shared_runners_enabled
false
factory
:ci_project
do
factory
:ci_project
do
token
'iPWx6WM4lhHNedGfBpPJNP'
token
'iPWx6WM4lhHNedGfBpPJNP'
end
end
...
...
spec/models/application_setting_spec.rb
View file @
4fda9ef8
...
@@ -28,11 +28,11 @@
...
@@ -28,11 +28,11 @@
require
'spec_helper'
require
'spec_helper'
describe
ApplicationSetting
,
models:
true
do
describe
ApplicationSetting
,
models:
true
do
it
{
expect
(
ApplicationSetting
.
create_from_defaults
).
to
be_valid
}
context
'restricted signup domains'
do
let
(
:setting
)
{
ApplicationSetting
.
create_from_defaults
}
let
(
:setting
)
{
ApplicationSetting
.
create_from_defaults
}
it
{
expect
(
setting
).
to
be_valid
}
context
'restricted signup domains'
do
it
'set single domain'
do
it
'set single domain'
do
setting
.
restricted_signup_domains_raw
=
'example.com'
setting
.
restricted_signup_domains_raw
=
'example.com'
expect
(
setting
.
restricted_signup_domains
).
to
eq
([
'example.com'
])
expect
(
setting
.
restricted_signup_domains
).
to
eq
([
'example.com'
])
...
@@ -53,4 +53,26 @@ describe ApplicationSetting, models: true do
...
@@ -53,4 +53,26 @@ describe ApplicationSetting, models: true do
expect
(
setting
.
restricted_signup_domains
).
to
eq
([
'example.com'
,
'*.example.com'
])
expect
(
setting
.
restricted_signup_domains
).
to
eq
([
'example.com'
,
'*.example.com'
])
end
end
end
end
context
'shared runners'
do
let
(
:gl_project
)
{
create
(
:empty_project
)
}
before
do
allow_any_instance_of
(
Project
).
to
receive
(
:current_application_settings
).
and_return
(
setting
)
end
subject
{
gl_project
.
ensure_gitlab_ci_project
.
shared_runners_enabled
}
context
'enabled'
do
before
{
setting
.
update_attributes
(
shared_runners_enabled:
true
)
}
it
{
is_expected
.
to
be_truthy
}
end
context
'disabled'
do
before
{
setting
.
update_attributes
(
shared_runners_enabled:
false
)
}
it
{
is_expected
.
to
be_falsey
}
end
end
end
end
spec/services/ci/register_build_service_spec.rb
View file @
4fda9ef8
...
@@ -70,6 +70,10 @@ module Ci
...
@@ -70,6 +70,10 @@ module Ci
end
end
context
'disallow shared runners'
do
context
'disallow shared runners'
do
before
do
gl_project
.
gitlab_ci_project
.
update
(
shared_runners_enabled:
false
)
end
context
'shared runner'
do
context
'shared runner'
do
let
(
:build
)
{
service
.
execute
(
shared_runner
)
}
let
(
:build
)
{
service
.
execute
(
shared_runner
)
}
...
...
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