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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
Show 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
...
@@ -346,15 +346,14 @@ describe Ci::Build, models: true do
describe
:artifacts_download_url
do
describe
:artifacts_download_url
do
subject
{
build
.
artifacts_download_url
}
subject
{
build
.
artifacts_download_url
}
it
"should be nil if artifact doesn't exist"
do
context
'artifacts file does not exist'
do
b
uild
.
update_attributes
(
artifacts_file:
nil
)
b
efore
{
build
.
update_attributes
(
artifacts_file:
nil
)
}
i
s_expected
.
to
be_nil
i
t
{
is_expected
.
to
be_nil
}
end
end
it
'should not be nil if artifact exist'
do
context
'artifacts file exists'
do
gif
=
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
)
let
(
:build
)
{
create
(
:ci_build
,
:artifacts
)
}
build
.
update_attributes
(
artifacts_file:
gif
)
it
{
is_expected
.
to_not
be_nil
}
is_expected
.
to_not
be_nil
end
end
end
end
...
@@ -381,11 +380,7 @@ describe Ci::Build, models: true do
...
@@ -381,11 +380,7 @@ describe Ci::Build, models: true do
end
end
context
'artifacts archive exists'
do
context
'artifacts archive exists'
do
before
do
let
(
:build
)
{
create
(
:ci_build
,
:artifacts
)
}
gif
=
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
)
build
.
update_attributes
(
artifacts_file:
gif
)
end
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
end
end
end
end
...
@@ -398,16 +393,7 @@ describe Ci::Build, models: true do
...
@@ -398,16 +393,7 @@ describe Ci::Build, models: true do
end
end
context
'artifacts archive is a zip file and metadata exists'
do
context
'artifacts archive is a zip file and metadata exists'
do
before
do
let
(
:build
)
{
create
(
:ci_build
,
:artifacts
)
}
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
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
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