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
652eb011
Commit
652eb011
authored
Jun 12, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rc/load-images-in-phantomjs' into 'master'
Let PhantomJS load local images See merge request !12003
parents
de6c1165
448fc23e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
features/support/capybara.rb
features/support/capybara.rb
+3
-1
spec/features/help_pages_spec.rb
spec/features/help_pages_spec.rb
+5
-11
spec/features/projects/artifacts/file_spec.rb
spec/features/projects/artifacts/file_spec.rb
+1
-0
spec/support/capybara.rb
spec/support/capybara.rb
+3
-1
No files found.
features/support/capybara.rb
View file @
652eb011
...
...
@@ -11,8 +11,10 @@ Capybara.register_driver :poltergeist do |app|
js_errors:
true
,
timeout:
timeout
,
window_size:
[
1366
,
768
],
url_whitelist:
%w[localhost 127.0.0.1]
,
url_blacklist:
%w[.mp4 .png .gif .avi .bmp .jpg .jpeg]
,
phantomjs_options:
[
'--load-images=
no
'
'--load-images=
yes
'
]
)
end
...
...
spec/features/help_pages_spec.rb
View file @
652eb011
...
...
@@ -34,7 +34,7 @@ describe 'Help Pages', feature: true do
end
end
context
'in a production environment with version check enabled'
,
js:
true
do
context
'in a production environment with version check enabled'
,
:js
do
before
do
allow
(
Rails
.
env
).
to
receive
(
:production?
)
{
true
}
allow
(
current_application_settings
).
to
receive
(
:version_check_enabled
)
{
true
}
...
...
@@ -44,18 +44,12 @@ describe 'Help Pages', feature: true do
visit
help_path
end
it
'
should display
a version check image'
do
expect
(
find
(
'.js-version-status-badge'
)).
to
be_visible
it
'
has
a version check image'
do
expect
(
find
(
'.js-version-status-badge'
,
visible:
false
)[
'src'
]).
to
end_with
(
'/version-check-url'
)
end
it
'should have a src url'
do
expect
(
find
(
'.js-version-status-badge'
)[
'src'
]).
to
match
(
/\/version-check-url/
)
end
it
'should hide the version check image if the image request fails'
do
# We use '--load-images=no' with poltergeist so we must trigger manually
execute_script
(
"$('.js-version-status-badge').trigger('error');"
)
it
'hides the version check image if the image request fails'
do
# We use '--load-images=yes' with poltergeist so the image fails to load
expect
(
find
(
'.js-version-status-badge'
,
visible:
false
)).
not_to
be_visible
end
end
...
...
spec/features/projects/artifacts/file_spec.rb
View file @
652eb011
...
...
@@ -39,6 +39,7 @@ feature 'Artifact file', :js, feature: true do
context
'JPG file'
do
before
do
page
.
driver
.
browser
.
url_blacklist
=
[]
visit_file
(
'rails_sample.jpg'
)
wait_for_requests
...
...
spec/support/capybara.rb
View file @
652eb011
...
...
@@ -14,8 +14,10 @@ Capybara.register_driver :poltergeist do |app|
js_errors:
true
,
timeout:
timeout
,
window_size:
[
1366
,
768
],
url_whitelist:
%w[localhost 127.0.0.1]
,
url_blacklist:
%w[.mp4 .png .gif .avi .bmp .jpg .jpeg]
,
phantomjs_options:
[
'--load-images=
no
'
'--load-images=
yes
'
]
)
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