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
53d1c87c
Commit
53d1c87c
authored
Jun 05, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Fog mocking
parent
3201988b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
18 deletions
+16
-18
spec/initializers/fog_google_https_private_urls_spec.rb
spec/initializers/fog_google_https_private_urls_spec.rb
+6
-6
spec/lib/backup/manager_spec.rb
spec/lib/backup/manager_spec.rb
+2
-5
spec/lib/object_storage/direct_upload_spec.rb
spec/lib/object_storage/direct_upload_spec.rb
+4
-0
spec/spec_helper.rb
spec/spec_helper.rb
+4
-0
spec/uploaders/object_storage_spec.rb
spec/uploaders/object_storage_spec.rb
+0
-7
No files found.
spec/initializers/fog_google_https_private_urls_spec.rb
View file @
53d1c87c
require
'spec_helper'
describe
'Fog::Storage::GoogleXML::File'
do
describe
'Fog::Storage::GoogleXML::File'
,
:fog_requests
do
let
(
:storage
)
do
Fog
.
mock!
Fog
::
Storage
.
new
(
{
google_storage_access_key_id:
"asdf"
,
google_storage_secret_access_key:
"asdf"
,
provider:
"Google"
}
)
Fog
::
Storage
.
new
(
google_storage_access_key_id:
"asdf"
,
google_storage_secret_access_key:
"asdf"
,
provider:
"Google"
)
end
let
(
:file
)
do
...
...
spec/lib/backup/manager_spec.rb
View file @
53d1c87c
...
...
@@ -274,16 +274,13 @@ describe Backup::Manager do
}
)
# the Fog mock only knows about directories we create explicitly
Fog
.
mock!
# the Fog mock only knows about directories we create explicitly
connection
=
::
Fog
::
Storage
.
new
(
Gitlab
.
config
.
backup
.
upload
.
connection
.
symbolize_keys
)
connection
.
directories
.
create
(
key:
Gitlab
.
config
.
backup
.
upload
.
remote_directory
)
end
after
do
Fog
.
unmock!
end
context
'target path'
do
it
'uses the tar filename by default'
do
expect_any_instance_of
(
Fog
::
Collection
).
to
receive
(
:create
)
...
...
spec/lib/object_storage/direct_upload_spec.rb
View file @
53d1c87c
...
...
@@ -17,6 +17,10 @@ describe ObjectStorage::DirectUpload do
let
(
:direct_upload
)
{
described_class
.
new
(
credentials
,
bucket_name
,
object_name
,
has_length:
has_length
,
maximum_size:
maximum_size
)
}
before
do
Fog
.
unmock!
end
describe
'#has_length'
do
context
'is known'
do
let
(
:has_length
)
{
true
}
...
...
spec/spec_helper.rb
View file @
53d1c87c
...
...
@@ -133,6 +133,10 @@ RSpec.configure do |config|
RequestStore
.
clear!
end
config
.
after
(
:example
)
do
Fog
.
unmock!
if
Fog
.
mock?
end
config
.
before
(
:example
,
:mailer
)
do
reset_delivered_emails!
end
...
...
spec/uploaders/object_storage_spec.rb
View file @
53d1c87c
...
...
@@ -360,13 +360,6 @@ describe ObjectStorage do
subject
{
uploader_class
.
workhorse_authorize
(
has_length:
has_length
,
maximum_size:
maximum_size
)
}
before
do
# ensure that we use regular Fog libraries
# other tests might call `Fog.mock!` and
# it will make tests to fail
Fog
.
unmock!
end
shared_examples
'uses local storage'
do
it
"returns temporary path"
do
is_expected
.
to
have_key
(
:TempPath
)
...
...
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