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
11a5971b
Commit
11a5971b
authored
May 08, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some missing parens in project_spec and runner_spec
parent
c8bfb3e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+24
-24
No files found.
spec/models/ci/runner_spec.rb
View file @
11a5971b
...
@@ -198,7 +198,7 @@ describe Ci::Runner do
...
@@ -198,7 +198,7 @@ describe Ci::Runner do
end
end
describe
'#assign_to'
do
describe
'#assign_to'
do
let!
(
:project
)
{
FactoryBot
.
create
:project
}
let!
(
:project
)
{
FactoryBot
.
create
(
:project
)
}
let!
(
:shared_runner
)
{
FactoryBot
.
create
(
:ci_runner
,
:shared
)
}
let!
(
:shared_runner
)
{
FactoryBot
.
create
(
:ci_runner
,
:shared
)
}
before
do
before
do
...
...
spec/models/project_spec.rb
View file @
11a5971b
...
@@ -309,12 +309,12 @@ describe Project do
...
@@ -309,12 +309,12 @@ describe Project do
describe
'project token'
do
describe
'project token'
do
it
'sets an random token if none provided'
do
it
'sets an random token if none provided'
do
project
=
FactoryBot
.
create
:project
,
runners_token:
''
project
=
FactoryBot
.
create
(
:project
,
runners_token:
''
)
expect
(
project
.
runners_token
).
not_to
eq
(
''
)
expect
(
project
.
runners_token
).
not_to
eq
(
''
)
end
end
it
'does not set an random token if one provided'
do
it
'does not set an random token if one provided'
do
project
=
FactoryBot
.
create
:project
,
runners_token:
'my-token'
project
=
FactoryBot
.
create
(
:project
,
runners_token:
'my-token'
)
expect
(
project
.
runners_token
).
to
eq
(
'my-token'
)
expect
(
project
.
runners_token
).
to
eq
(
'my-token'
)
end
end
end
end
...
@@ -639,7 +639,7 @@ describe Project do
...
@@ -639,7 +639,7 @@ describe Project do
describe
'#to_param'
do
describe
'#to_param'
do
context
'with namespace'
do
context
'with namespace'
do
before
do
before
do
@group
=
create
:group
,
name:
'gitlab'
@group
=
create
(
:group
,
name:
'gitlab'
)
@project
=
create
(
:project
,
name:
'gitlabhq'
,
namespace:
@group
)
@project
=
create
(
:project
,
name:
'gitlabhq'
,
namespace:
@group
)
end
end
...
@@ -866,8 +866,8 @@ describe Project do
...
@@ -866,8 +866,8 @@ describe Project do
describe
'#star_count'
do
describe
'#star_count'
do
it
'counts stars from multiple users'
do
it
'counts stars from multiple users'
do
user1
=
create
:user
user1
=
create
(
:user
)
user2
=
create
:user
user2
=
create
(
:user
)
project
=
create
(
:project
,
:public
)
project
=
create
(
:project
,
:public
)
expect
(
project
.
star_count
).
to
eq
(
0
)
expect
(
project
.
star_count
).
to
eq
(
0
)
...
@@ -889,7 +889,7 @@ describe Project do
...
@@ -889,7 +889,7 @@ describe Project do
end
end
it
'counts stars on the right project'
do
it
'counts stars on the right project'
do
user
=
create
:user
user
=
create
(
:user
)
project1
=
create
(
:project
,
:public
)
project1
=
create
(
:project
,
:public
)
project2
=
create
(
:project
,
:public
)
project2
=
create
(
:project
,
:public
)
...
@@ -1148,9 +1148,9 @@ describe Project do
...
@@ -1148,9 +1148,9 @@ describe Project do
describe
'#any_runners?'
do
describe
'#any_runners?'
do
context
'shared runners'
do
context
'shared runners'
do
let
(
:project
)
{
create
:project
,
shared_runners_enabled:
shared_runners_enabled
}
let
(
:project
)
{
create
(
:project
,
shared_runners_enabled:
shared_runners_enabled
)
}
let
(
:specific_runner
)
{
create
:ci_runner
}
let
(
:specific_runner
)
{
create
(
:ci_runner
)
}
let
(
:shared_runner
)
{
create
:ci_runner
,
:shared
}
let
(
:shared_runner
)
{
create
(
:ci_runner
,
:shared
)
}
context
'for shared runners disabled'
do
context
'for shared runners disabled'
do
let
(
:shared_runners_enabled
)
{
false
}
let
(
:shared_runners_enabled
)
{
false
}
...
@@ -1208,9 +1208,9 @@ describe Project do
...
@@ -1208,9 +1208,9 @@ describe Project do
end
end
context
'group runners'
do
context
'group runners'
do
let
(
:project
)
{
create
:project
,
group_runners_enabled:
group_runners_enabled
}
let
(
:project
)
{
create
(
:project
,
group_runners_enabled:
group_runners_enabled
)
}
let
(
:group
)
{
create
:group
,
projects:
[
project
]
}
let
(
:group
)
{
create
(
:group
,
projects:
[
project
])
}
let
(
:group_runner
)
{
create
:ci_runner
,
groups:
[
group
]
}
let
(
:group_runner
)
{
create
(
:ci_runner
,
groups:
[
group
])
}
context
'for group runners disabled'
do
context
'for group runners disabled'
do
let
(
:group_runners_enabled
)
{
false
}
let
(
:group_runners_enabled
)
{
false
}
...
@@ -1292,7 +1292,7 @@ describe Project do
...
@@ -1292,7 +1292,7 @@ describe Project do
end
end
describe
'#pages_deployed?'
do
describe
'#pages_deployed?'
do
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
(
:project
)
}
subject
{
project
.
pages_deployed?
}
subject
{
project
.
pages_deployed?
}
...
@@ -1310,8 +1310,8 @@ describe Project do
...
@@ -1310,8 +1310,8 @@ describe Project do
end
end
describe
'#pages_url'
do
describe
'#pages_url'
do
let
(
:group
)
{
create
:group
,
name:
group_name
}
let
(
:group
)
{
create
(
:group
,
name:
group_name
)
}
let
(
:project
)
{
create
:project
,
namespace:
group
,
name:
project_name
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
,
name:
project_name
)
}
let
(
:domain
)
{
'Example.com'
}
let
(
:domain
)
{
'Example.com'
}
subject
{
project
.
pages_url
}
subject
{
project
.
pages_url
}
...
@@ -1337,8 +1337,8 @@ describe Project do
...
@@ -1337,8 +1337,8 @@ describe Project do
end
end
describe
'#pages_group_url'
do
describe
'#pages_group_url'
do
let
(
:group
)
{
create
:group
,
name:
group_name
}
let
(
:group
)
{
create
(
:group
,
name:
group_name
)
}
let
(
:project
)
{
create
:project
,
namespace:
group
,
name:
project_name
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
,
name:
project_name
)
}
let
(
:domain
)
{
'Example.com'
}
let
(
:domain
)
{
'Example.com'
}
let
(
:port
)
{
1234
}
let
(
:port
)
{
1234
}
...
@@ -1455,8 +1455,8 @@ describe Project do
...
@@ -1455,8 +1455,8 @@ describe Project do
let
(
:private_group
)
{
create
(
:group
,
visibility_level:
0
)
}
let
(
:private_group
)
{
create
(
:group
,
visibility_level:
0
)
}
let
(
:internal_group
)
{
create
(
:group
,
visibility_level:
10
)
}
let
(
:internal_group
)
{
create
(
:group
,
visibility_level:
10
)
}
let
(
:private_project
)
{
create
:project
,
:private
,
group:
private_group
}
let
(
:private_project
)
{
create
(
:project
,
:private
,
group:
private_group
)
}
let
(
:internal_project
)
{
create
:project
,
:internal
,
group:
internal_group
}
let
(
:internal_project
)
{
create
(
:project
,
:internal
,
group:
internal_group
)
}
context
'when group is private project can not be internal'
do
context
'when group is private project can not be internal'
do
it
{
expect
(
private_project
.
visibility_level_allowed?
(
Gitlab
::
VisibilityLevel
::
INTERNAL
)).
to
be_falsey
}
it
{
expect
(
private_project
.
visibility_level_allowed?
(
Gitlab
::
VisibilityLevel
::
INTERNAL
)).
to
be_falsey
}
...
@@ -2452,8 +2452,8 @@ describe Project do
...
@@ -2452,8 +2452,8 @@ describe Project do
end
end
describe
'#pages_url'
do
describe
'#pages_url'
do
let
(
:group
)
{
create
:group
,
name:
'Group'
}
let
(
:group
)
{
create
(
:group
,
name:
'Group'
)
}
let
(
:nested_group
)
{
create
:group
,
parent:
group
}
let
(
:nested_group
)
{
create
(
:group
,
parent:
group
)
}
let
(
:domain
)
{
'Example.com'
}
let
(
:domain
)
{
'Example.com'
}
subject
{
project
.
pages_url
}
subject
{
project
.
pages_url
}
...
@@ -2464,7 +2464,7 @@ describe Project do
...
@@ -2464,7 +2464,7 @@ describe Project do
end
end
context
'top-level group'
do
context
'top-level group'
do
let
(
:project
)
{
create
:project
,
namespace:
group
,
name:
project_name
}
let
(
:project
)
{
create
(
:project
,
namespace:
group
,
name:
project_name
)
}
context
'group page'
do
context
'group page'
do
let
(
:project_name
)
{
'group.example.com'
}
let
(
:project_name
)
{
'group.example.com'
}
...
@@ -2480,7 +2480,7 @@ describe Project do
...
@@ -2480,7 +2480,7 @@ describe Project do
end
end
context
'nested group'
do
context
'nested group'
do
let
(
:project
)
{
create
:project
,
namespace:
nested_group
,
name:
project_name
}
let
(
:project
)
{
create
(
:project
,
namespace:
nested_group
,
name:
project_name
)
}
let
(
:expected_url
)
{
"http://group.example.com/
#{
nested_group
.
path
}
/
#{
project
.
path
}
"
}
let
(
:expected_url
)
{
"http://group.example.com/
#{
nested_group
.
path
}
/
#{
project
.
path
}
"
}
context
'group page'
do
context
'group page'
do
...
@@ -2498,7 +2498,7 @@ describe Project do
...
@@ -2498,7 +2498,7 @@ describe Project do
end
end
describe
'#http_url_to_repo'
do
describe
'#http_url_to_repo'
do
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
(
:project
)
}
it
'returns the url to the repo without a username'
do
it
'returns the url to the repo without a username'
do
expect
(
project
.
http_url_to_repo
).
to
eq
(
"
#{
project
.
web_url
}
.git"
)
expect
(
project
.
http_url_to_repo
).
to
eq
(
"
#{
project
.
web_url
}
.git"
)
...
...
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