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
89b18120
Commit
89b18120
authored
Feb 01, 2016
by
Grzegorz Bizon
Committed by
Grzegorz Bizon
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use build artifacts trait in build specs
parent
5e1edd37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
22 deletions
+8
-22
spec/models/build_spec.rb
spec/models/build_spec.rb
+8
-22
No files found.
spec/models/build_spec.rb
View file @
89b18120
...
...
@@ -346,15 +346,14 @@ describe Ci::Build, models: true do
describe
:artifacts_download_url
do
subject
{
build
.
artifacts_download_url
}
it
"should be nil if artifact doesn't exist"
do
b
uild
.
update_attributes
(
artifacts_file:
nil
)
i
s_expected
.
to
be_nil
context
'artifacts file does not exist'
do
b
efore
{
build
.
update_attributes
(
artifacts_file:
nil
)
}
i
t
{
is_expected
.
to
be_nil
}
end
it
'should not be nil if artifact exist'
do
gif
=
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
)
build
.
update_attributes
(
artifacts_file:
gif
)
is_expected
.
to_not
be_nil
context
'artifacts file exists'
do
let
(
:build
)
{
create
(
:ci_build
,
:artifacts
)
}
it
{
is_expected
.
to_not
be_nil
}
end
end
...
...
@@ -381,11 +380,7 @@ describe Ci::Build, models: true do
end
context
'artifacts archive exists'
do
before
do
gif
=
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
)
build
.
update_attributes
(
artifacts_file:
gif
)
end
let
(
:build
)
{
create
(
:ci_build
,
:artifacts
)
}
it
{
is_expected
.
to
be_truthy
}
end
end
...
...
@@ -398,16 +393,7 @@ describe Ci::Build, models: true do
end
context
'artifacts archive is a zip file and metadata exists'
do
before
do
fixture_dir
=
Rails
.
root
+
'spec/fixtures/'
archive
=
fixture_file_upload
(
fixture_dir
+
'ci_build_artifacts.zip'
,
'application/zip'
)
metadata
=
fixture_file_upload
(
fixture_dir
+
'ci_build_artifacts_metadata.gz'
,
'application/x-gzip'
)
build
.
update_attributes
(
artifacts_file:
archive
)
build
.
update_attributes
(
artifacts_metadata:
metadata
)
end
let
(
:build
)
{
create
(
:ci_build
,
:artifacts
)
}
it
{
is_expected
.
to
be_truthy
}
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