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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
02bd24e3
Commit
02bd24e3
authored
Jun 21, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rubocop offenses in spplication helper specs
parent
35acd04d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
30 deletions
+4
-30
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+4
-30
No files found.
spec/helpers/application_helper_spec.rb
View file @
02bd24e3
...
@@ -82,31 +82,6 @@ describe ApplicationHelper do
...
@@ -82,31 +82,6 @@ describe ApplicationHelper do
end
end
describe
'avatar_icon'
do
describe
'avatar_icon'
do
<<<<<<<
HEAD
it
'returns an url for the avatar'
do
user
=
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
avatar_url
=
"/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
expect
(
helper
.
avatar_icon
(
user
.
email
).
to_s
).
to
match
(
avatar_url
)
allow
(
ActionController
::
Base
).
to
receive
(
:asset_host
).
and_return
(
gitlab_host
)
avatar_url
=
"
#{
gitlab_host
}
/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
expect
(
helper
.
avatar_icon
(
user
.
email
).
to_s
).
to
match
(
avatar_url
)
end
it
'returns an url for the avatar with relative url'
do
stub_config_setting
(
relative_url_root:
'/gitlab'
)
# Must be stubbed after the stub above, and separately
stub_config_setting
(
url:
Settings
.
send
(
:build_gitlab_url
))
user
=
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
expect
(
helper
.
avatar_icon
(
user
.
email
).
to_s
)
.
to
match
(
"/gitlab/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
end
=======
let
(
:user
)
{
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
}
let
(
:user
)
{
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
}
context
'using an email'
do
context
'using an email'
do
...
@@ -162,17 +137,16 @@ describe ApplicationHelper do
...
@@ -162,17 +137,16 @@ describe ApplicationHelper do
describe
'using a user'
do
describe
'using a user'
do
context
'when only_path is true'
do
context
'when only_path is true'
do
it
'returns a relative URL for the avatar'
do
it
'returns a relative URL for the avatar'
do
expect
(
helper
.
avatar_icon
(
user
,
only_path:
true
).
to_s
)
.
expect
(
helper
.
avatar_icon
(
user
,
only_path:
true
).
to_s
)
to
eq
(
"/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
.
to
eq
(
"/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
end
end
end
end
context
'when only_path is false'
do
context
'when only_path is false'
do
it
'returns an absolute URL for the avatar'
do
it
'returns an absolute URL for the avatar'
do
expect
(
helper
.
avatar_icon
(
user
,
only_path:
false
).
to_s
)
.
expect
(
helper
.
avatar_icon
(
user
,
only_path:
false
).
to_s
)
to
eq
(
"
#{
gitlab_host
}
/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
.
to
eq
(
"
#{
gitlab_host
}
/uploads/system/user/avatar/
#{
user
.
id
}
/banana_sample.gif"
)
end
end
>>>>>>>
master
end
end
end
end
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