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
b38c75b3
Commit
b38c75b3
authored
Jun 06, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct more usages of non-relative `fixture_file_upload` paths
parent
6d165c74
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
19 deletions
+13
-19
spec/features/projects/jobs/permissions_spec.rb
spec/features/projects/jobs/permissions_spec.rb
+1
-2
spec/helpers/emails_helper_spec.rb
spec/helpers/emails_helper_spec.rb
+1
-3
spec/helpers/groups_helper_spec.rb
spec/helpers/groups_helper_spec.rb
+4
-4
spec/requests/api/project_import_spec.rb
spec/requests/api/project_import_spec.rb
+1
-1
spec/services/projects/update_pages_service_spec.rb
spec/services/projects/update_pages_service_spec.rb
+1
-1
spec/uploaders/gitlab_uploader_spec.rb
spec/uploaders/gitlab_uploader_spec.rb
+1
-1
spec/uploaders/job_artifact_uploader_spec.rb
spec/uploaders/job_artifact_uploader_spec.rb
+3
-5
spec/uploaders/legacy_artifact_uploader_spec.rb
spec/uploaders/legacy_artifact_uploader_spec.rb
+1
-2
No files found.
spec/features/projects/jobs/permissions_spec.rb
View file @
b38c75b3
...
@@ -88,8 +88,7 @@ describe 'Project Jobs Permissions' do
...
@@ -88,8 +88,7 @@ describe 'Project Jobs Permissions' do
describe
'artifacts page'
do
describe
'artifacts page'
do
context
'when recent job has artifacts available'
do
context
'when recent job has artifacts available'
do
before
do
before
do
artifacts
=
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts.zip'
)
archive
=
fixture_file_upload
(
'spec/fixtures/ci_build_artifacts.zip'
)
archive
=
fixture_file_upload
(
artifacts
,
'application/zip'
)
job
.
update_attributes
(
legacy_artifacts_file:
archive
)
job
.
update_attributes
(
legacy_artifacts_file:
archive
)
end
end
...
...
spec/helpers/emails_helper_spec.rb
View file @
b38c75b3
...
@@ -47,9 +47,7 @@ describe EmailsHelper do
...
@@ -47,9 +47,7 @@ describe EmailsHelper do
describe
'#header_logo'
do
describe
'#header_logo'
do
context
'there is a brand item with a logo'
do
context
'there is a brand item with a logo'
do
it
'returns the brand header logo'
do
it
'returns the brand header logo'
do
appearance
=
create
:appearance
,
header_logo:
fixture_file_upload
(
appearance
=
create
:appearance
,
header_logo:
fixture_file_upload
(
'spec/fixtures/dk.png'
)
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
expect
(
header_logo
).
to
eq
(
expect
(
header_logo
).
to
eq
(
%{<img style="height: 50px" src="/uploads/-/system/appearance/header_logo/#{appearance.id}/dk.png" alt="Dk" />}
%{<img style="height: 50px" src="/uploads/-/system/appearance/header_logo/#{appearance.id}/dk.png" alt="Dk" />}
...
...
spec/helpers/groups_helper_spec.rb
View file @
b38c75b3
...
@@ -4,9 +4,9 @@ describe GroupsHelper do
...
@@ -4,9 +4,9 @@ describe GroupsHelper do
include
ApplicationHelper
include
ApplicationHelper
describe
'group_icon'
do
describe
'group_icon'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
it
'returns an url for the avatar'
do
it
'returns an url for the avatar'
do
avatar_file_path
=
File
.
join
(
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
group
=
create
(
:group
)
group
=
create
(
:group
)
group
.
avatar
=
fixture_file_upload
(
avatar_file_path
)
group
.
avatar
=
fixture_file_upload
(
avatar_file_path
)
group
.
save!
group
.
save!
...
@@ -17,9 +17,9 @@ describe GroupsHelper do
...
@@ -17,9 +17,9 @@ describe GroupsHelper do
end
end
describe
'group_icon_url'
do
describe
'group_icon_url'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
it
'returns an url for the avatar'
do
it
'returns an url for the avatar'
do
avatar_file_path
=
File
.
join
(
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
group
=
create
(
:group
)
group
=
create
(
:group
)
group
.
avatar
=
fixture_file_upload
(
avatar_file_path
)
group
.
avatar
=
fixture_file_upload
(
avatar_file_path
)
group
.
save!
group
.
save!
...
...
spec/requests/api/project_import_spec.rb
View file @
b38c75b3
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
API
::
ProjectImport
do
describe
API
::
ProjectImport
do
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_export_spec"
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/project_export_spec"
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:file
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'features'
,
'projects'
,
'import_export'
,
'test_project_export.tar.gz'
)
}
let
(
:file
)
{
File
.
join
(
'spec'
,
'features'
,
'projects'
,
'import_export'
,
'test_project_export.tar.gz'
)
}
let
(
:namespace
)
{
create
(
:group
)
}
let
(
:namespace
)
{
create
(
:group
)
}
before
do
before
do
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:storage_path
).
and_return
(
export_path
)
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:storage_path
).
and_return
(
export_path
)
...
...
spec/services/projects/update_pages_service_spec.rb
View file @
b38c75b3
...
@@ -10,7 +10,7 @@ describe Projects::UpdatePagesService do
...
@@ -10,7 +10,7 @@ describe Projects::UpdatePagesService do
let
(
:file
)
{
fixture_file_upload
(
"spec/fixtures/pages.
#{
extension
}
"
)
}
let
(
:file
)
{
fixture_file_upload
(
"spec/fixtures/pages.
#{
extension
}
"
)
}
let
(
:empty_file
)
{
fixture_file_upload
(
"spec/fixtures/pages_empty.
#{
extension
}
"
)
}
let
(
:empty_file
)
{
fixture_file_upload
(
"spec/fixtures/pages_empty.
#{
extension
}
"
)
}
let
(
:metadata
)
do
let
(
:metadata
)
do
filename
=
Rails
.
root
+
"spec/fixtures/pages.
#{
extension
}
.meta"
filename
=
"spec/fixtures/pages.
#{
extension
}
.meta"
fixture_file_upload
(
filename
)
if
File
.
exist?
(
filename
)
fixture_file_upload
(
filename
)
if
File
.
exist?
(
filename
)
end
end
...
...
spec/uploaders/gitlab_uploader_spec.rb
View file @
b38c75b3
...
@@ -62,7 +62,7 @@ describe GitlabUploader do
...
@@ -62,7 +62,7 @@ describe GitlabUploader do
expect
(
FileUtils
).
to
receive
(
:mv
).
with
(
anything
,
/^
#{
subject
.
work_dir
}
/
).
and_call_original
expect
(
FileUtils
).
to
receive
(
:mv
).
with
(
anything
,
/^
#{
subject
.
work_dir
}
/
).
and_call_original
expect
(
FileUtils
).
to
receive
(
:mv
).
with
(
/^
#{
subject
.
work_dir
}
/
,
/
#{
subject
.
cache_dir
}
/
).
and_call_original
expect
(
FileUtils
).
to
receive
(
:mv
).
with
(
/^
#{
subject
.
work_dir
}
/
,
/
#{
subject
.
cache_dir
}
/
).
and_call_original
fixture
=
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'rails_sample.jpg'
)
fixture
=
File
.
join
(
'spec'
,
'fixtures'
,
'rails_sample.jpg'
)
subject
.
cache!
(
fixture_file_upload
(
fixture
))
subject
.
cache!
(
fixture_file_upload
(
fixture
))
expect
(
subject
.
file
.
path
).
to
match
(
/
#{
subject
.
cache_dir
}
/
)
expect
(
subject
.
file
.
path
).
to
match
(
/
#{
subject
.
cache_dir
}
/
)
...
...
spec/uploaders/job_artifact_uploader_spec.rb
View file @
b38c75b3
...
@@ -29,8 +29,7 @@ describe JobArtifactUploader do
...
@@ -29,8 +29,7 @@ describe JobArtifactUploader do
context
'when trace is stored in File storage'
do
context
'when trace is stored in File storage'
do
context
'when file exists'
do
context
'when file exists'
do
let
(
:file
)
do
let
(
:file
)
do
fixture_file_upload
(
fixture_file_upload
(
'spec/fixtures/trace/sample_trace'
,
'text/plain'
)
Rails
.
root
.
join
(
'spec/fixtures/trace/sample_trace'
),
'text/plain'
)
end
end
before
do
before
do
...
@@ -63,8 +62,7 @@ describe JobArtifactUploader do
...
@@ -63,8 +62,7 @@ describe JobArtifactUploader do
context
'file is stored in valid local_path'
do
context
'file is stored in valid local_path'
do
let
(
:file
)
do
let
(
:file
)
do
fixture_file_upload
(
fixture_file_upload
(
'spec/fixtures/ci_build_artifacts.zip'
,
'application/zip'
)
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts.zip'
),
'application/zip'
)
end
end
before
do
before
do
...
@@ -81,7 +79,7 @@ describe JobArtifactUploader do
...
@@ -81,7 +79,7 @@ describe JobArtifactUploader do
describe
"#migrate!"
do
describe
"#migrate!"
do
before
do
before
do
uploader
.
store!
(
fixture_file_upload
(
File
.
join
(
'spec/fixtures/trace/sample_trace'
)
))
uploader
.
store!
(
fixture_file_upload
(
'spec/fixtures/trace/sample_trace'
))
stub_artifacts_object_storage
stub_artifacts_object_storage
end
end
...
...
spec/uploaders/legacy_artifact_uploader_spec.rb
View file @
b38c75b3
...
@@ -44,8 +44,7 @@ describe LegacyArtifactUploader do
...
@@ -44,8 +44,7 @@ describe LegacyArtifactUploader do
context
'file is stored in valid path'
do
context
'file is stored in valid path'
do
let
(
:file
)
do
let
(
:file
)
do
fixture_file_upload
(
fixture_file_upload
(
'spec/fixtures/ci_build_artifacts.zip'
,
'application/zip'
)
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts.zip'
),
'application/zip'
)
end
end
before
do
before
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