Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-08 12:55:07 +0300
committerRémy Coutable <remy@rymai.me>2017-06-12 20:00:03 +0300
commit448fc23e4743198f2c1bf3cd10eb515eeb9f424b (patch)
treed26521068afb92ef87384e42dad45c60991d8396 /spec/features/help_pages_spec.rb
parent194c40df208526d5dc4401bc06f91d803def3740 (diff)
Let PhantomJS load local images
This change fix a memory leak due to a Webkit bug: https://github.com/ariya/phantomjs/issues/12903 Also: - Whitelist only localhost and 127.0.0.1 in Capybara + JS specs - Blacklist all requests to media such as images, videos, PDFs, CSVs etc. - Log all the requests made. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/features/help_pages_spec.rb')
-rw-r--r--spec/features/help_pages_spec.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb
index e0b2404e60a..31014f5cad2 100644
--- a/spec/features/help_pages_spec.rb
+++ b/spec/features/help_pages_spec.rb
@@ -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