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
Léo-Paul Géneau
gitlab-ce
Commits
154270a3
Commit
154270a3
authored
May 16, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test container related specs
parent
a40d915c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
0 deletions
+76
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+75
-0
spec/requests/ci/api/runners_spec.rb
spec/requests/ci/api/runners_spec.rb
+1
-0
No files found.
spec/models/project_spec.rb
View file @
154270a3
...
@@ -772,4 +772,79 @@ describe Project, models: true do
...
@@ -772,4 +772,79 @@ describe Project, models: true do
expect
(
project
.
protected_branch?
(
'foo'
)).
to
eq
(
false
)
expect
(
project
.
protected_branch?
(
'foo'
)).
to
eq
(
false
)
end
end
end
end
describe
'#container_registry_repository'
do
let
(
:project
)
{
create
(
:empty_project
)
}
subject
{
project
.
container_registry_repository
}
it
{
is_expected
.
to_not
be_nil
}
end
describe
'#container_registry_repository_url'
do
let
(
:project
)
{
create
(
:empty_project
)
}
subject
{
project
.
container_registry_repository_url
}
before
{
allow
(
Gitlab
.
config
.
registry
).
to
receive_messages
(
registry_settings
)
}
context
'for enabled registry'
do
let
(
:registry_settings
)
do
{
enabled:
true
,
host_port:
'example.com'
,
}
end
it
{
is_expected
.
to_not
be_nil
}
end
context
'for disabled registry'
do
let
(
:registry_settings
)
do
{
enabled:
false
}
end
it
{
is_expected
.
to
be_nil
}
end
end
describe
'#has_container_registry_tags?'
do
let
(
:project
)
{
create
(
:empty_project
)
}
subject
{
project
.
has_container_registry_tags?
}
before
{
allow
(
Gitlab
.
config
.
registry
).
to
receive_messages
(
registry_settings
)
}
context
'for enabled registry'
do
let
(
:registry_settings
)
do
{
enabled:
true
}
end
context
'with tags'
do
before
{
stub_container_registry
(
'test'
,
'test2'
)
}
it
{
is_expected
.
to
be_truthy
}
end
context
'when no tags'
do
before
{
stub_container_registry
}
it
{
is_expected
.
to
be_falsey
}
end
end
context
'for disabled registry'
do
let
(
:registry_settings
)
do
{
enabled:
false
}
end
it
{
is_expected
.
to
be_falsey
}
end
end
end
end
spec/requests/ci/api/runners_spec.rb
View file @
154270a3
...
@@ -7,6 +7,7 @@ describe Ci::API::API do
...
@@ -7,6 +7,7 @@ describe Ci::API::API do
let
(
:registration_token
)
{
'abcdefg123456'
}
let
(
:registration_token
)
{
'abcdefg123456'
}
before
do
before
do
stub_gitlab_calls
stub_application_setting
(
runners_registration_token:
registration_token
)
stub_application_setting
(
runners_registration_token:
registration_token
)
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