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
370bf56a
Commit
370bf56a
authored
Oct 03, 2017
by
Zeger-Jan van de Weg
Committed by
Eric Eastwood
Oct 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests for new implementation
parent
ff980ab3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
58 deletions
+3
-58
spec/features/projects/artifacts/browse_spec.rb
spec/features/projects/artifacts/browse_spec.rb
+3
-6
spec/helpers/artifact_helper_spec.rb
spec/helpers/artifact_helper_spec.rb
+0
-52
No files found.
spec/features/projects/artifacts/browse_spec.rb
View file @
370bf56a
require
'spec_helper'
feature
'Browse artifact'
,
:js
do
include
ArtifactHelper
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
let
(
:job
)
{
create
(
:ci_build
,
:artifacts
,
pipeline:
pipeline
)
}
...
...
@@ -24,8 +22,8 @@ feature 'Browse artifact', :js do
end
end
context
'when browsing a directory with an
HTML
file'
do
let
(
:
html_entry
)
{
job
.
artifacts_metadata_entry
(
"other_artifacts_0.1.2/index.html"
)
}
context
'when browsing a directory with an
text
file'
do
let
(
:
txt_entry
)
{
job
.
artifacts_metadata_entry
(
'other_artifacts_0.1.2/doc_sample.txt'
)
}
before
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:enabled
).
and_return
(
true
)
...
...
@@ -37,8 +35,7 @@ feature 'Browse artifact', :js do
it
"shows external link icon and styles"
do
link
=
first
(
'.tree-item-file-external-link'
)
expect
(
link
).
to
have_content
(
'index.html'
)
expect
(
link
[
:href
]).
to
eq
(
html_artifact_url
(
project
,
job
,
html_entry
.
blob
))
expect
(
link
).
to
have_content
(
'doc_sample.txt'
)
expect
(
page
).
to
have_selector
(
'.js-artifact-tree-external-icon'
)
end
end
...
...
spec/helpers/artifact_helper_spec.rb
deleted
100644 → 0
View file @
ff980ab3
require
'spec_helper'
describe
ArtifactHelper
do
set
(
:job
)
{
create
(
:ci_build
,
:artifacts
)
}
let
(
:html_entry
)
{
job
.
artifacts_metadata_entry
(
"other_artifacts_0.1.2/index.html"
)
}
let
(
:txt_entry
)
{
job
.
artifacts_metadata_entry
(
"other_artifacts_0.1.2/doc_sample.txt"
)
}
before
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:enabled
).
and_return
(
true
)
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:artifacts_server
).
and_return
(
true
)
end
describe
'#link_to_artifact'
do
context
'link_to_pages returns true'
do
subject
{
link_to_artifact
(
job
.
project
,
job
,
entry
)
}
before
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:enabled
).
and_return
(
true
)
end
context
'when the entry is HTML'
do
let
(
:entry
)
{
html_entry
}
it
{
is_expected
.
to
match
Gitlab
.
config
.
pages
.
host
}
it
{
is_expected
.
to
match
/-\/jobs\/\d+\/artifacts/
}
end
context
'when the entry is not HTML'
do
let
(
:entry
)
{
txt_entry
}
it
{
is_expected
.
not_to
match
Gitlab
.
config
.
pages
.
host
}
end
end
end
describe
'#external_url?'
do
context
'pages enabled'
do
before
do
allow
(
Gitlab
.
config
.
pages
).
to
receive
(
:artifacts_server
).
and_return
(
true
)
end
it
'returns true for HTML files'
do
expect
(
external_url?
(
txt_entry
.
blob
)).
to
be
(
false
)
end
it
'returns true for HTML files'
do
expect
(
external_url?
(
html_entry
.
blob
)).
to
be
(
true
)
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