Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
69d4f15e2a69
Commit
69d4f15e
authored
Feb 21, 2017
by
Douwe Maan
Browse files
Enable Style/SpaceInsideBrackets
parent
0932578f6584
Changes
33
Hide whitespace changes
Inline
Side-by-side
.rubocop.yml
View file @
69d4f15e
...
...
@@ -413,6 +413,9 @@
Style/SpaceBeforeSemicolon
:
Enabled
:
true
Style/SpaceInsideBrackets
:
Enabled
:
true
# Use spaces inside hash literal braces - or don't.
Style/SpaceInsideHashLiteralBraces
:
Enabled
:
true
...
...
.rubocop_todo.yml
View file @
69d4f15e
...
...
@@ -729,11 +729,6 @@
Style/SpaceInsideBlockBraces
:
Enabled
:
false
# Offense count: 120
# Cop supports --auto-correct.
Style/SpaceInsideBrackets
:
Enabled
:
false
# Offense count: 90
# Cop supports --auto-correct.
Style/SpaceInsideParens
:
...
...
app/helpers/submodule_helper.rb
View file @
69d4f15e
...
...
@@ -37,8 +37,8 @@
end
def
self_url?
(
url
,
namespace
,
project
)
return
true
if
url
==
[
Gitlab
.
config
.
gitlab
.
url
,
'/'
,
namespace
,
'/'
,
project
,
'.git'
].
join
(
''
)
return
true
if
url
==
[
Gitlab
.
config
.
gitlab
.
url
,
'/'
,
namespace
,
'/'
,
project
,
'.git'
].
join
(
''
)
url
==
gitlab_shell
.
url_to_repo
([
namespace
,
'/'
,
project
].
join
(
''
))
end
...
...
@@ -48,8 +48,8 @@
end
def
standard_links
(
host
,
namespace
,
project
,
commit
)
base
=
[
'https://'
,
host
,
'/'
,
namespace
,
'/'
,
project
].
join
(
''
)
[
base
,
[
base
,
'/tree/'
,
commit
].
join
(
''
)]
base
=
[
'https://'
,
host
,
'/'
,
namespace
,
'/'
,
project
].
join
(
''
)
[
base
,
[
base
,
'/tree/'
,
commit
].
join
(
''
)]
end
def
relative_self_links
(
url
,
commit
)
...
...
app/models/concerns/issuable.rb
View file @
69d4f15e
...
...
@@ -68,7 +68,7 @@
scope
:without_label
,
->
{
joins
(
"LEFT OUTER JOIN label_links ON label_links.target_type = '
#{
name
}
' AND label_links.target_id =
#{
table_name
}
.id"
).
where
(
label_links:
{
id:
nil
})
}
scope
:join_project
,
->
{
joins
(
:project
)
}
scope
:inc_notes_with_associations
,
->
{
includes
(
notes:
[
:project
,
:author
,
:award_emoji
])
}
scope
:inc_notes_with_associations
,
->
{
includes
(
notes:
[
:project
,
:author
,
:award_emoji
])
}
scope
:references_project
,
->
{
references
(
:project
)
}
scope
:non_archived
,
->
{
join_project
.
where
(
projects:
{
archived:
false
})
}
...
...
app/models/concerns/reactive_service.rb
View file @
69d4f15e
...
...
@@ -5,6 +5,6 @@
include
ReactiveCaching
# Default cache key: class name + project_id
self
.
reactive_cache_key
=
->
(
service
)
{
[
service
.
class
.
model_name
.
singular
,
service
.
project_id
]
}
self
.
reactive_cache_key
=
->
(
service
)
{
[
service
.
class
.
model_name
.
singular
,
service
.
project_id
]
}
end
end
app/models/project_services/kubernetes_service.rb
View file @
69d4f15e
...
...
@@ -3,7 +3,7 @@
include
Gitlab
::
Kubernetes
include
ReactiveCaching
self
.
reactive_cache_key
=
->
(
service
)
{
[
service
.
class
.
model_name
.
singular
,
service
.
project_id
]
}
self
.
reactive_cache_key
=
->
(
service
)
{
[
service
.
class
.
model_name
.
singular
,
service
.
project_id
]
}
# Namespace defaults to the project path, but can be overridden in case that
# is an invalid or inappropriate name
...
...
@@ -167,7 +167,7 @@
url
=
URI
.
parse
(
api_url
)
prefix
=
url
.
path
.
sub
(
%r{/+
\z
}
,
''
)
url
.
path
=
[
prefix
,
*
parts
].
join
(
"/"
)
url
.
path
=
[
prefix
,
*
parts
].
join
(
"/"
)
url
.
to_s
end
...
...
config/initializers/1_settings.rb
View file @
69d4f15e
...
...
@@ -19,7 +19,7 @@
else
custom_port
=
":
#{
gitlab
.
port
}
"
end
[
gitlab
.
protocol
,
[
gitlab
.
protocol
,
"://"
,
gitlab
.
host
,
custom_port
,
...
...
@@ -80,7 +80,7 @@
def
base_url
(
config
)
custom_port
=
on_standard_port?
(
config
)
?
nil
:
":
#{
config
.
port
}
"
[
config
.
protocol
,
[
config
.
protocol
,
"://"
,
config
.
host
,
custom_port
...
...
config/initializers/devise.rb
View file @
69d4f15e
...
...
@@ -24,7 +24,7 @@
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
config
.
authentication_keys
=
[
:login
]
config
.
authentication_keys
=
[
:login
]
# Configure parameters from the request object used for authentication. Each entry
# given should be a request method and it will automatically be passed to the
...
...
@@ -36,8 +36,8 @@
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
config
.
case_insensitive_keys
=
[
:email
]
config
.
case_insensitive_keys
=
[
:email
]
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
...
...
@@ -40,8 +40,8 @@
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
config
.
strip_whitespace_keys
=
[
:email
]
config
.
strip_whitespace_keys
=
[
:email
]
# Tell if authentication through request.params is enabled. True by default.
# config.params_authenticatable = true
...
...
@@ -124,7 +124,7 @@
config
.
lock_strategy
=
:failed_attempts
# Defines which key will be used when locking and unlocking an account
config
.
unlock_keys
=
[
:email
]
config
.
unlock_keys
=
[
:email
]
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
...
...
config/initializers/trusted_proxies.rb
View file @
69d4f15e
...
...
@@ -21,4 +21,4 @@
end
.
compact
Rails
.
application
.
config
.
action_dispatch
.
trusted_proxies
=
(
[
'127.0.0.1'
,
'::1'
]
+
gitlab_trusted_proxies
)
[
'127.0.0.1'
,
'::1'
]
+
gitlab_trusted_proxies
)
lib/api/api_guard.rb
View file @
69d4f15e
...
...
@@ -114,7 +114,7 @@
private
def
install_error_responders
(
base
)
error_classes
=
[
MissingTokenError
,
TokenNotFoundError
,
error_classes
=
[
MissingTokenError
,
TokenNotFoundError
,
ExpiredError
,
RevokedError
,
InsufficientScopeError
]
base
.
send
:rescue_from
,
*
error_classes
,
oauth2_bearer_token_error_handler
...
...
lib/api/award_emoji.rb
View file @
69d4f15e
...
...
@@ -15,7 +15,7 @@
requires
:"
#{
awardable_id_string
}
"
,
type:
Integer
,
desc:
"The ID of an Issue, Merge Request or Snippet"
end
[
":id/
#{
awardable_string
}
/:
#{
awardable_id_string
}
/award_emoji"
,
[
":id/
#{
awardable_string
}
/:
#{
awardable_id_string
}
/award_emoji"
,
":id/
#{
awardable_string
}
/:
#{
awardable_id_string
}
/notes/:note_id/award_emoji"
].
each
do
|
endpoint
|
...
...
lib/api/projects.rb
View file @
69d4f15e
...
...
@@ -19,7 +19,7 @@
optional
:visibility_level
,
type:
Integer
,
values:
[
Gitlab
::
VisibilityLevel
::
PRIVATE
,
Gitlab
::
VisibilityLevel
::
INTERNAL
,
Gitlab
::
VisibilityLevel
::
PUBLIC
],
desc:
'Create a public project. The same as visibility_level = 20.'
Gitlab
::
VisibilityLevel
::
PUBLIC
],
desc:
'Create a public project. The same as visibility_level = 20.'
optional
:public_builds
,
type:
Boolean
,
desc:
'Perform public builds'
optional
:request_access_enabled
,
type:
Boolean
,
desc:
'Allow users to request member access'
optional
:only_allow_merge_if_build_succeeds
,
type:
Boolean
,
desc:
'Only allow to merge if builds succeed'
...
...
lib/api/repositories.rb
View file @
69d4f15e
...
...
@@ -45,7 +45,7 @@
requires
:sha
,
type:
String
,
desc:
'The commit, branch name, or tag name'
requires
:filepath
,
type:
String
,
desc:
'The path to the file to display'
end
get
[
":id/repository/blobs/:sha"
,
":id/repository/commits/:sha/blob"
]
do
get
[
":id/repository/blobs/:sha"
,
":id/repository/commits/:sha/blob"
]
do
repo
=
user_project
.
repository
commit
=
repo
.
commit
(
params
[
:sha
])
...
...
lib/api/v3/projects.rb
View file @
69d4f15e
...
...
@@ -20,7 +20,7 @@
optional
:visibility_level
,
type:
Integer
,
values:
[
Gitlab
::
VisibilityLevel
::
PRIVATE
,
Gitlab
::
VisibilityLevel
::
INTERNAL
,
Gitlab
::
VisibilityLevel
::
PUBLIC
],
desc:
'Create a public project. The same as visibility_level = 20.'
Gitlab
::
VisibilityLevel
::
PUBLIC
],
desc:
'Create a public project. The same as visibility_level = 20.'
optional
:public_builds
,
type:
Boolean
,
desc:
'Perform public builds'
optional
:request_access_enabled
,
type:
Boolean
,
desc:
'Allow users to request member access'
optional
:only_allow_merge_if_build_succeeds
,
type:
Boolean
,
desc:
'Only allow to merge if builds succeed'
...
...
spec/helpers/issues_helper_spec.rb
View file @
69d4f15e
...
...
@@ -55,7 +55,7 @@
describe
"merge_requests_sentence"
do
subject
{
merge_requests_sentence
(
merge_requests
)}
let
(
:merge_requests
)
do
[
build
(
:merge_request
,
iid:
1
),
build
(
:merge_request
,
iid:
2
),
[
build
(
:merge_request
,
iid:
1
),
build
(
:merge_request
,
iid:
2
),
build
(
:merge_request
,
iid:
3
)]
end
...
...
spec/helpers/submodule_helper_spec.rb
View file @
69d4f15e
...
...
@@ -20,10 +20,10 @@
it
'detects ssh on standard port'
do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
22
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
stub_url
([
config
.
user
,
'@'
,
config
.
host
,
':gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
stub_url
([
config
.
user
,
'@'
,
config
.
host
,
':gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)])
end
it
'detects ssh on non-standard port'
do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
2222
)
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
...
...
@@ -25,12 +25,12 @@
end
it
'detects ssh on non-standard port'
do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_port
).
and_return
(
2222
)
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:ssh_path_prefix
).
and_return
(
Settings
.
send
(
:build_gitlab_shell_ssh_path_prefix
))
stub_url
([
'ssh://'
,
config
.
user
,
'@'
,
config
.
host
,
':2222/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
stub_url
([
'ssh://'
,
config
.
user
,
'@'
,
config
.
host
,
':2222/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)])
end
it
'detects http on standard port'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
...
...
@@ -32,12 +32,12 @@
end
it
'detects http on standard port'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
stub_url
([
'http://'
,
config
.
host
,
'/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
stub_url
([
'http://'
,
config
.
host
,
'/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)])
end
it
'detects http on non-standard port'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
3000
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
...
...
@@ -39,13 +39,13 @@
end
it
'detects http on non-standard port'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
3000
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
stub_url
([
'http://'
,
config
.
host
,
':3000/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
stub_url
([
'http://'
,
config
.
host
,
':3000/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)])
end
it
'works with relative_url_root'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:relative_url_root
).
and_return
(
'/gitlab/root'
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
...
...
@@ -46,14 +46,14 @@
end
it
'works with relative_url_root'
do
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:port
).
and_return
(
80
)
# set this just to be sure
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:relative_url_root
).
and_return
(
'/gitlab/root'
)
allow
(
Gitlab
.
config
.
gitlab
).
to
receive
(
:url
).
and_return
(
Settings
.
send
(
:build_gitlab_url
))
stub_url
([
'http://'
,
config
.
host
,
'/gitlab/root/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)
])
stub_url
([
'http://'
,
config
.
host
,
'/gitlab/root/gitlab-org/gitlab-ce.git'
].
join
(
''
))
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
namespace_project_path
(
'gitlab-org'
,
'gitlab-ce'
),
namespace_project_tree_path
(
'gitlab-org'
,
'gitlab-ce'
,
'hash'
)])
end
end
context
'submodule on github.com'
do
it
'detects ssh'
do
stub_url
(
'git@github.com:gitlab-org/gitlab-ce.git'
)
...
...
@@ -54,11 +54,11 @@
end
end
context
'submodule on github.com'
do
it
'detects ssh'
do
stub_url
(
'git@github.com:gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
end
it
'detects http'
do
stub_url
(
'http://github.com/gitlab-org/gitlab-ce.git'
)
...
...
@@ -61,9 +61,9 @@
end
it
'detects http'
do
stub_url
(
'http://github.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
end
it
'detects https'
do
stub_url
(
'https://github.com/gitlab-org/gitlab-ce.git'
)
...
...
@@ -66,9 +66,9 @@
end
it
'detects https'
do
stub_url
(
'https://github.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://github.com/gitlab-org/gitlab-ce'
,
'https://github.com/gitlab-org/gitlab-ce/tree/hash'
])
end
it
'returns original with non-standard url'
do
stub_url
(
'http://github.com/gitlab-org/gitlab-ce'
)
...
...
@@ -71,7 +71,7 @@
end
it
'returns original with non-standard url'
do
stub_url
(
'http://github.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
stub_url
(
'http://github.com/another/gitlab-org/gitlab-ce.git'
)
...
...
@@ -76,9 +76,9 @@
stub_url
(
'http://github.com/another/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
end
end
context
'submodule on gitlab.com'
do
it
'detects ssh'
do
stub_url
(
'git@gitlab.com:gitlab-org/gitlab-ce.git'
)
...
...
@@ -79,11 +79,11 @@
end
end
context
'submodule on gitlab.com'
do
it
'detects ssh'
do
stub_url
(
'git@gitlab.com:gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
end
it
'detects http'
do
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce.git'
)
...
...
@@ -86,9 +86,9 @@
end
it
'detects http'
do
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
end
it
'detects https'
do
stub_url
(
'https://gitlab.com/gitlab-org/gitlab-ce.git'
)
...
...
@@ -91,9 +91,9 @@
end
it
'detects https'
do
stub_url
(
'https://gitlab.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
'https://gitlab.com/gitlab-org/gitlab-ce'
,
'https://gitlab.com/gitlab-org/gitlab-ce/tree/hash'
])
end
it
'returns original with non-standard url'
do
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce'
)
...
...
@@ -96,7 +96,7 @@
end
it
'returns original with non-standard url'
do
stub_url
(
'http://gitlab.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
stub_url
(
'http://gitlab.com/another/gitlab-org/gitlab-ce.git'
)
...
...
@@ -101,9 +101,9 @@
stub_url
(
'http://gitlab.com/another/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
end
end
context
'submodule on unsupported'
do
it
'returns original'
do
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce'
)
...
...
@@ -104,9 +104,9 @@
end
end
context
'submodule on unsupported'
do
it
'returns original'
do
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce.git'
)
...
...
@@ -111,6 +111,6 @@
stub_url
(
'http://mygitserver.com/gitlab-org/gitlab-ce.git'
)
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
expect
(
submodule_links
(
submodule_item
)).
to
eq
([
repo
.
submodule_url_for
,
nil
])
end
end
...
...
spec/initializers/trusted_proxies_spec.rb
View file @
69d4f15e
...
...
@@ -27,7 +27,7 @@
context
'with private IP ranges added'
do
before
do
set_trusted_proxies
([
"10.0.0.0/8"
,
"172.16.0.0/12"
,
"192.168.0.0/16"
])
set_trusted_proxies
([
"10.0.0.0/8"
,
"172.16.0.0/12"
,
"192.168.0.0/16"
])
end
it
'filters out private and local IPs'
do
...
...
@@ -39,7 +39,7 @@
context
'with proxy IP added'
do
before
do
set_trusted_proxies
([
"60.98.25.47"
])
set_trusted_proxies
([
"60.98.25.47"
])
end
it
'filters out proxy IP'
do
...
...
spec/lib/bitbucket/representation/repo_spec.rb
View file @
69d4f15e
...
...
@@ -42,7 +42,7 @@
describe
'#clone_url'
do
it
'builds url'
do
data
=
{
'links'
=>
{
'clone'
=>
[
{
'name'
=>
'https'
,
'href'
=>
'https://bibucket.org/test/test.git'
}]
}
}
data
=
{
'links'
=>
{
'clone'
=>
[{
'name'
=>
'https'
,
'href'
=>
'https://bibucket.org/test/test.git'
}]
}
}
expect
(
described_class
.
new
(
data
).
clone_url
(
'abc'
)).
to
eq
(
'https://x-token-auth:abc@bibucket.org/test/test.git'
)
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
69d4f15e
...
...
@@ -580,7 +580,7 @@
context
'when syntax is incorrect'
do
context
'when variables defined but invalid'
do
let
(
:variables
)
do
[
'VAR1'
,
'value1'
,
'VAR2'
,
'value2'
]
[
'VAR1'
,
'value1'
,
'VAR2'
,
'value2'
]
end
it
'raises error'
do
...
...
spec/lib/gitlab/ci/config/entry/key_spec.rb
View file @
69d4f15e
...
...
@@ -21,7 +21,7 @@
end
context
'when entry value is not correct'
do
let
(
:config
)
{
[
'incorrect'
]
}
let
(
:config
)
{
[
'incorrect'
]
}
describe
'#errors'
do
it
'saves errors'
do
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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