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
94eff655
Commit
94eff655
authored
Jun 22, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/SpaceInsideHashLiteralBraces cop violations
These fixes were performed automatically by Rubocop's `-a` flag.
parent
56246b70
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
45 additions
and
45 deletions
+45
-45
spec/controllers/profiles/preferences_controller_spec.rb
spec/controllers/profiles/preferences_controller_spec.rb
+1
-1
spec/helpers/tab_helper_spec.rb
spec/helpers/tab_helper_spec.rb
+2
-2
spec/lib/extracts_path_spec.rb
spec/lib/extracts_path_spec.rb
+1
-1
spec/lib/gitlab/asciidoc_spec.rb
spec/lib/gitlab/asciidoc_spec.rb
+2
-2
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
+1
-1
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
+1
-1
spec/lib/gitlab/markdown/autolink_filter_spec.rb
spec/lib/gitlab/markdown/autolink_filter_spec.rb
+2
-2
spec/lib/gitlab/satellite/action_spec.rb
spec/lib/gitlab/satellite/action_spec.rb
+3
-3
spec/models/commit_range_spec.rb
spec/models/commit_range_spec.rb
+2
-2
spec/models/hooks/service_hook_spec.rb
spec/models/hooks/service_hook_spec.rb
+3
-3
spec/models/hooks/system_hook_spec.rb
spec/models/hooks/system_hook_spec.rb
+10
-10
spec/models/hooks/web_hook_spec.rb
spec/models/hooks/web_hook_spec.rb
+3
-3
spec/models/project_services/hipchat_service_spec.rb
spec/models/project_services/hipchat_service_spec.rb
+3
-3
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+1
-1
spec/models/service_spec.rb
spec/models/service_spec.rb
+1
-1
spec/models/wiki_page_spec.rb
spec/models/wiki_page_spec.rb
+4
-4
spec/requests/api/groups_spec.rb
spec/requests/api/groups_spec.rb
+3
-3
spec/tasks/gitlab/backup_rake_spec.rb
spec/tasks/gitlab/backup_rake_spec.rb
+2
-2
No files found.
spec/controllers/profiles/preferences_controller_spec.rb
View file @
94eff655
...
...
@@ -63,7 +63,7 @@ describe Profiles::PreferencesController do
context
'on invalid dashboard setting'
do
it
'sets the flash'
do
prefs
=
{
dashboard:
'invalid'
}
prefs
=
{
dashboard:
'invalid'
}
go
params:
prefs
...
...
spec/helpers/tab_helper_spec.rb
View file @
94eff655
...
...
@@ -37,8 +37,8 @@ describe TabHelper do
end
it
"passes extra html options to the list element"
do
expect
(
nav_link
(
action: :foo
,
html_options:
{
class:
'home'
})).
to
match
(
/<li class="home active">/
)
expect
(
nav_link
(
html_options:
{
class:
'active'
})).
to
match
(
/<li class="active">/
)
expect
(
nav_link
(
action: :foo
,
html_options:
{
class:
'home'
})).
to
match
(
/<li class="home active">/
)
expect
(
nav_link
(
html_options:
{
class:
'active'
})).
to
match
(
/<li class="active">/
)
end
end
end
spec/lib/extracts_path_spec.rb
View file @
94eff655
...
...
@@ -15,7 +15,7 @@ describe ExtractsPath do
describe
'#assign_ref'
do
let
(
:ref
)
{
sample_commit
[
:id
]
}
let
(
:params
)
{
{
path:
sample_commit
[
:line_code_path
],
ref:
ref
}
}
let
(
:params
)
{
{
path:
sample_commit
[
:line_code_path
],
ref:
ref
}
}
before
do
@project
=
create
(
:project
)
...
...
spec/lib/gitlab/asciidoc_spec.rb
View file @
94eff655
...
...
@@ -22,7 +22,7 @@ module Gitlab
context
"with asciidoc_opts"
do
let
(
:asciidoc_opts
)
{
{
safe: :safe
,
attributes:
[
'foo'
]
}
}
let
(
:asciidoc_opts
)
{
{
safe: :safe
,
attributes:
[
'foo'
]
}
}
it
"should merge the options with default ones"
do
expected_asciidoc_opts
=
{
safe: :safe
,
backend: :html5
,
...
...
@@ -38,7 +38,7 @@ module Gitlab
context
"with project in context"
do
let
(
:context
)
{
{
project:
create
(
:project
)
}
}
let
(
:context
)
{
{
project:
create
(
:project
)
}
}
it
"should filter converted input via HTML pipeline and return result"
do
filtered_html
=
'<b>ASCII</b>'
...
...
spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
View file @
94eff655
...
...
@@ -6,7 +6,7 @@ describe Gitlab::BitbucketImport::ProjectCreator do
name:
'Vim'
,
slug:
'vim'
,
is_private:
true
,
owner:
"asd"
}.
with_indifferent_access
owner:
"asd"
}.
with_indifferent_access
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
...
...
spec/lib/gitlab/gitlab_import/project_creator_spec.rb
View file @
94eff655
...
...
@@ -8,7 +8,7 @@ describe Gitlab::GitlabImport::ProjectCreator do
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
,
path_with_namespace:
'asd/vim'
,
http_url_to_repo:
"https://gitlab.com/asd/vim.git"
,
owner:
{
name:
"john"
}
}.
with_indifferent_access
owner:
{
name:
"john"
}
}.
with_indifferent_access
}
let
(
:namespace
){
create
(
:group
,
owner:
user
)
}
...
...
spec/lib/gitlab/markdown/autolink_filter_spec.rb
View file @
94eff655
...
...
@@ -48,7 +48,7 @@ module Gitlab::Markdown
end
it
'accepts link_attr options'
do
doc
=
filter
(
"See
#{
link
}
"
,
link_attr:
{
class:
'custom'
})
doc
=
filter
(
"See
#{
link
}
"
,
link_attr:
{
class:
'custom'
})
expect
(
doc
.
at_css
(
'a'
)[
'class'
]).
to
eq
'custom'
end
...
...
@@ -89,7 +89,7 @@ module Gitlab::Markdown
end
it
'accepts link_attr options'
do
doc
=
filter
(
"See
#{
link
}
"
,
link_attr:
{
class:
'custom'
})
doc
=
filter
(
"See
#{
link
}
"
,
link_attr:
{
class:
'custom'
})
expect
(
doc
.
at_css
(
'a'
)[
'class'
]).
to
eq
'custom'
end
...
...
spec/lib/gitlab/satellite/action_spec.rb
View file @
94eff655
...
...
@@ -17,10 +17,10 @@ describe 'Gitlab::Satellite::Action' do
starting_remote_count
=
repo
.
git
.
list_remotes
.
size
expect
(
starting_remote_count
).
to
be
>=
1
#kind of hookey way to add a second remote
origin_uri
=
repo
.
git
.
remote
({
v:
true
}).
split
(
" "
)[
1
]
origin_uri
=
repo
.
git
.
remote
({
v:
true
}).
split
(
" "
)[
1
]
repo
.
git
.
remote
({
raise:
true
},
'add'
,
'another-remote'
,
origin_uri
)
repo
.
git
.
branch
({
raise:
true
},
'a-new-branch'
)
repo
.
git
.
remote
({
raise:
true
},
'add'
,
'another-remote'
,
origin_uri
)
repo
.
git
.
branch
({
raise:
true
},
'a-new-branch'
)
expect
(
repo
.
heads
.
size
).
to
be
>
(
starting_remote_count
)
expect
(
repo
.
git
.
remote
().
split
(
" "
).
size
).
to
be
>
(
starting_remote_count
)
...
...
spec/models/commit_range_spec.rb
View file @
94eff655
...
...
@@ -60,11 +60,11 @@ describe CommitRange do
end
it
'includes the correct values for a three-dot range'
do
expect
(
range
.
to_param
).
to
eq
({
from:
sha_from
,
to:
sha_to
})
expect
(
range
.
to_param
).
to
eq
({
from:
sha_from
,
to:
sha_to
})
end
it
'includes the correct values for a two-dot range'
do
expect
(
range2
.
to_param
).
to
eq
({
from:
sha_from
+
'^'
,
to:
sha_to
})
expect
(
range2
.
to_param
).
to
eq
({
from:
sha_from
+
'^'
,
to:
sha_to
})
end
end
...
...
spec/models/hooks/service_hook_spec.rb
View file @
94eff655
...
...
@@ -26,7 +26,7 @@ describe ServiceHook do
describe
"execute"
do
before
(
:each
)
do
@service_hook
=
create
(
:service_hook
)
@data
=
{
project_id:
1
,
data:
{}}
@data
=
{
project_id:
1
,
data:
{}
}
WebMock
.
stub_request
(
:post
,
@service_hook
.
url
)
end
...
...
@@ -34,7 +34,7 @@ describe ServiceHook do
it
"POSTs to the web hook URL"
do
@service_hook
.
execute
(
@data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@service_hook
.
url
).
with
(
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Service Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Service Hook'
}
).
once
end
...
...
@@ -43,7 +43,7 @@ describe ServiceHook do
@service_hook
.
execute
(
@data
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@service_hook
.
url
).
with
(
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Service Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Service Hook'
}
).
once
end
...
...
spec/models/hooks/system_hook_spec.rb
View file @
94eff655
...
...
@@ -29,7 +29,7 @@ describe SystemHook do
Projects
::
CreateService
.
new
(
create
(
:user
),
name:
'empty'
).
execute
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/project_create/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -39,7 +39,7 @@ describe SystemHook do
Projects
::
DestroyService
.
new
(
project
,
user
,
{}).
execute
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/project_destroy/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -47,7 +47,7 @@ describe SystemHook do
create
(
:user
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/user_create/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -56,7 +56,7 @@ describe SystemHook do
user
.
destroy
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/user_destroy/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -66,7 +66,7 @@ describe SystemHook do
project
.
team
<<
[
user
,
:master
]
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/user_add_to_team/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -77,7 +77,7 @@ describe SystemHook do
project
.
project_members
.
destroy_all
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/user_remove_from_team/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -85,7 +85,7 @@ describe SystemHook do
create
(
:group
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/group_create/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -94,7 +94,7 @@ describe SystemHook do
group
.
destroy
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/group_destroy/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -104,7 +104,7 @@ describe SystemHook do
group
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/user_add_to_group/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
@@ -115,7 +115,7 @@ describe SystemHook do
group
.
group_members
.
destroy_all
expect
(
WebMock
).
to
have_requested
(
:post
,
@system_hook
.
url
).
with
(
body:
/user_remove_from_group/
,
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'System Hook'
}
).
once
end
...
...
spec/models/hooks/web_hook_spec.rb
View file @
94eff655
...
...
@@ -47,7 +47,7 @@ describe ProjectHook do
@project_hook
=
create
(
:project_hook
)
@project
=
create
(
:project
)
@project
.
hooks
<<
[
@project_hook
]
@data
=
{
before:
'oldrev'
,
after:
'newrev'
,
ref:
'ref'
}
@data
=
{
before:
'oldrev'
,
after:
'newrev'
,
ref:
'ref'
}
WebMock
.
stub_request
(
:post
,
@project_hook
.
url
)
end
...
...
@@ -55,7 +55,7 @@ describe ProjectHook do
it
"POSTs to the web hook URL"
do
@project_hook
.
execute
(
@data
,
'push_hooks'
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@project_hook
.
url
).
with
(
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Push Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Push Hook'
}
).
once
end
...
...
@@ -64,7 +64,7 @@ describe ProjectHook do
@project_hook
.
execute
(
@data
,
'push_hooks'
)
expect
(
WebMock
).
to
have_requested
(
:post
,
@project_hook
.
url
).
with
(
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Push Hook'
}
headers:
{
'Content-Type'
=>
'application/json'
,
'X-Gitlab-Event'
=>
'Push Hook'
}
).
once
end
...
...
spec/models/project_services/hipchat_service_spec.rb
View file @
94eff655
...
...
@@ -241,17 +241,17 @@ describe HipchatService do
context
"#message_options"
do
it
"should be set to the defaults"
do
expect
(
hipchat
.
send
(
:message_options
)).
to
eq
({
notify:
false
,
color:
'yellow'
})
expect
(
hipchat
.
send
(
:message_options
)).
to
eq
({
notify:
false
,
color:
'yellow'
})
end
it
"should set notfiy to true"
do
hipchat
.
stub
(
notify:
'1'
)
expect
(
hipchat
.
send
(
:message_options
)).
to
eq
({
notify:
true
,
color:
'yellow'
})
expect
(
hipchat
.
send
(
:message_options
)).
to
eq
({
notify:
true
,
color:
'yellow'
})
end
it
"should set the color"
do
hipchat
.
stub
(
color:
'red'
)
expect
(
hipchat
.
send
(
:message_options
)).
to
eq
({
notify:
false
,
color:
'red'
})
expect
(
hipchat
.
send
(
:message_options
)).
to
eq
({
notify:
false
,
color:
'red'
})
end
end
end
...
...
spec/models/project_wiki_spec.rb
View file @
94eff655
...
...
@@ -231,7 +231,7 @@ describe ProjectWiki do
end
def
commit_details
commit
=
{
name:
user
.
name
,
email:
user
.
email
,
message:
"test commit"
}
commit
=
{
name:
user
.
name
,
email:
user
.
email
,
message:
"test commit"
}
end
def
create_page
(
name
,
content
)
...
...
spec/models/service_spec.rb
View file @
94eff655
...
...
@@ -69,7 +69,7 @@ describe Service do
describe
"Template"
do
describe
"for pushover service"
do
let
(
:service_template
)
{
PushoverService
.
create
(
template:
true
,
properties:
{
device:
'MyDevice'
,
sound:
'mic'
,
priority:
4
,
api_key:
'123456789'
})
PushoverService
.
create
(
template:
true
,
properties:
{
device:
'MyDevice'
,
sound:
'mic'
,
priority:
4
,
api_key:
'123456789'
})
}
let
(
:project
)
{
create
(
:project
)
}
...
...
spec/models/wiki_page_spec.rb
View file @
94eff655
...
...
@@ -43,7 +43,7 @@ describe WikiPage do
describe
"validations"
do
before
do
subject
.
attributes
=
{
title:
'title'
,
content:
'content'
}
subject
.
attributes
=
{
title:
'title'
,
content:
'content'
}
end
it
"validates presence of title"
do
...
...
@@ -58,7 +58,7 @@ describe WikiPage do
end
before
do
@wiki_attr
=
{
title:
"Index"
,
content:
"Home Page"
,
format:
"markdown"
}
@wiki_attr
=
{
title:
"Index"
,
content:
"Home Page"
,
format:
"markdown"
}
end
describe
"#create"
do
...
...
@@ -82,7 +82,7 @@ describe WikiPage do
let
(
:title
)
{
'Index v1.2.3'
}
before
do
@wiki_attr
=
{
title:
title
,
content:
"Home Page"
,
format:
"markdown"
}
@wiki_attr
=
{
title:
title
,
content:
"Home Page"
,
format:
"markdown"
}
end
describe
"#create"
do
...
...
@@ -196,7 +196,7 @@ describe WikiPage do
end
def
commit_details
commit
=
{
name:
user
.
name
,
email:
user
.
email
,
message:
"test commit"
}
commit
=
{
name:
user
.
name
,
email:
user
.
email
,
message:
"test commit"
}
end
def
create_page
(
name
,
content
)
...
...
spec/requests/api/groups_spec.rb
View file @
94eff655
...
...
@@ -109,18 +109,18 @@ describe API::API, api: true do
end
it
"should not create group, duplicate"
do
post
api
(
"/groups"
,
user3
),
{
name:
'Duplicate Test'
,
path:
group2
.
path
}
post
api
(
"/groups"
,
user3
),
{
name:
'Duplicate Test'
,
path:
group2
.
path
}
expect
(
response
.
status
).
to
eq
(
400
)
expect
(
response
.
message
).
to
eq
(
"Bad Request"
)
end
it
"should return 400 bad request error if name not given"
do
post
api
(
"/groups"
,
user3
),
{
path:
group2
.
path
}
post
api
(
"/groups"
,
user3
),
{
path:
group2
.
path
}
expect
(
response
.
status
).
to
eq
(
400
)
end
it
"should return 400 bad request error if path not given"
do
post
api
(
"/groups"
,
user3
),
{
name:
'test'
}
post
api
(
"/groups"
,
user3
),
{
name:
'test'
}
expect
(
response
.
status
).
to
eq
(
400
)
end
end
...
...
spec/tasks/gitlab/backup_rake_spec.rb
View file @
94eff655
...
...
@@ -35,14 +35,14 @@ describe 'gitlab:app namespace rake task' do
let
(
:gitlab_version
)
{
Gitlab
::
VERSION
}
it
'should fail on mismatch'
do
YAML
.
stub
load_file:
{
gitlab_version:
"not
#{
gitlab_version
}
"
}
YAML
.
stub
load_file:
{
gitlab_version:
"not
#{
gitlab_version
}
"
}
expect
{
run_rake_task
(
'gitlab:backup:restore'
)
}.
to
(
raise_error
SystemExit
)
end
it
'should invoke restoration on mach'
do
YAML
.
stub
load_file:
{
gitlab_version:
gitlab_version
}
YAML
.
stub
load_file:
{
gitlab_version:
gitlab_version
}
expect
(
Rake
::
Task
[
"gitlab:backup:db:restore"
]).
to
receive
:invoke
expect
(
Rake
::
Task
[
"gitlab:backup:repo:restore"
]).
to
receive
:invoke
expect
(
Rake
::
Task
[
"gitlab:shell:setup"
]).
to
receive
:invoke
...
...
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