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
iv
gitlab-ce
Commits
f5b88710
Commit
f5b88710
authored
Apr 24, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tests_for_fog' into 'master'
Tests for fog
parents
1feaa336
fe1ca616
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
Gemfile
Gemfile
+2
-1
Gemfile.lock
Gemfile.lock
+4
-0
config/initializers/carrierwave.rb
config/initializers/carrierwave.rb
+12
-0
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+2
-2
No files found.
Gemfile
View file @
f5b88710
...
@@ -71,6 +71,7 @@ gem "carrierwave"
...
@@ -71,6 +71,7 @@ gem "carrierwave"
# for aws storage
# for aws storage
gem
"
fog
"
,
"~> 1.14"
,
group: :aws
gem
"
fog
"
,
"~> 1.14"
,
group: :aws
gem
"
unf
"
,
group: :aws
# Authorization
# Authorization
gem
"
six
"
gem
"
six
"
...
...
Gemfile.lock
View file @
f5b88710
...
@@ -531,6 +531,9 @@ GEM
...
@@ -531,6 +531,9 @@ GEM
execjs (>= 0.3.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
json (>= 1.8.0)
underscore-rails (1.4.4)
underscore-rails (1.4.4)
unf (0.1.4)
unf_ext
unf_ext (0.0.6)
unicorn (4.6.3)
unicorn (4.6.3)
kgio (~> 2.6)
kgio (~> 2.6)
rack
rack
...
@@ -659,6 +662,7 @@ DEPENDENCIES
...
@@ -659,6 +662,7 @@ DEPENDENCIES
turbolinks
turbolinks
uglifier
uglifier
underscore-rails (~> 1.4.4)
underscore-rails (~> 1.4.4)
unf
unicorn (~> 4.6.3)
unicorn (~> 4.6.3)
unicorn-worker-killer
unicorn-worker-killer
version_sorter
version_sorter
...
...
config/initializers/carrierwave.rb
View file @
f5b88710
...
@@ -18,4 +18,16 @@ if File.exists?(aws_file)
...
@@ -18,4 +18,16 @@ if File.exists?(aws_file)
config
.
fog_authenticated_url_expiration
=
1
<<
29
# optional time (in seconds) that authenticated urls will be valid.
config
.
fog_authenticated_url_expiration
=
1
<<
29
# optional time (in seconds) that authenticated urls will be valid.
# when fog_public is false and provider is AWS or Google, defaults to 600
# when fog_public is false and provider is AWS or Google, defaults to 600
end
end
# Mocking Fog requests, based on: https://github.com/carrierwaveuploader/carrierwave/wiki/How-to%3A-Test-Fog-based-uploaders
if
Rails
.
env
.
test?
Fog
.
mock!
connection
=
::
Fog
::
Storage
.
new
(
:aws_access_key_id
=>
AWS_CONFIG
[
'access_key_id'
],
:aws_secret_access_key
=>
AWS_CONFIG
[
'secret_access_key'
],
:provider
=>
'AWS'
,
:region
=>
AWS_CONFIG
[
'region'
]
)
connection
.
directories
.
create
(
:key
=>
AWS_CONFIG
[
'bucket'
])
end
end
end
spec/helpers/application_helper_spec.rb
View file @
f5b88710
...
@@ -46,7 +46,7 @@ describe ApplicationHelper do
...
@@ -46,7 +46,7 @@ describe ApplicationHelper do
group
=
create
(
:group
)
group
=
create
(
:group
)
group
.
avatar
=
File
.
open
(
avatar_file_path
)
group
.
avatar
=
File
.
open
(
avatar_file_path
)
group
.
save!
group
.
save!
group_icon
(
group
.
path
).
to_s
.
should
==
"/uploads/group/avatar/
#{
group
.
id
}
/gitlab_logo.png"
group_icon
(
group
.
path
).
to_s
.
should
match
(
"/uploads/group/avatar/
#{
group
.
id
}
/gitlab_logo.png"
)
end
end
it
"should give default avatar_icon when no avatar is present"
do
it
"should give default avatar_icon when no avatar is present"
do
...
@@ -63,7 +63,7 @@ describe ApplicationHelper do
...
@@ -63,7 +63,7 @@ describe ApplicationHelper do
user
=
create
(
:user
)
user
=
create
(
:user
)
user
.
avatar
=
File
.
open
(
avatar_file_path
)
user
.
avatar
=
File
.
open
(
avatar_file_path
)
user
.
save!
user
.
save!
avatar_icon
(
user
.
email
).
to_s
.
should
==
"/uploads/user/avatar/
#{
user
.
id
}
/gitlab_logo.png"
avatar_icon
(
user
.
email
).
to_s
.
should
match
(
"/uploads/user/avatar/
#{
user
.
id
}
/gitlab_logo.png"
)
end
end
it
"should call gravatar_icon when no avatar is present"
do
it
"should call gravatar_icon when no avatar is present"
do
...
...
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