diff options
author | Stan Hu <stanhu@gmail.com> | 2018-12-15 08:50:36 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-12-15 08:50:36 +0300 |
commit | c027101d34ebdbd935e2c2b35827323c110b3654 (patch) | |
tree | 890f940f540518255e72b4afe57562314d2ece64 /spec/features | |
parent | 9d57e8af694f0c7c27769f9bc412506c238d6016 (diff) | |
parent | fac5c0e7ddf487b620aa338f439a63931bddbfa2 (diff) |
Merge branch 'rs-transient-help-page-failure' into 'master'
Resolve transient failure in Help page spec
Closes #55372
See merge request gitlab-org/gitlab-ce!23839
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/help_pages_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index c29dfb01381..e24b1f4349d 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'Help Pages' do @@ -52,23 +54,21 @@ describe 'Help Pages' do end end - context 'in a production environment with version check enabled', :js do + context 'in a production environment with version check enabled' do before do - allow(Rails.env).to receive(:production?) { true } stub_application_setting(version_check_enabled: true) - allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' } + + allow(Rails.env).to receive(:production?).and_return(true) + allow(VersionCheck).to receive(:url).and_return('/version-check-url') sign_in(create(:user)) visit help_path end it 'has a version check image' do - expect(find('.js-version-status-badge', visible: false)['src']).to end_with('/version-check-url') - end - - 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(page).to have_selector('.js-version-status-badge', visible: false) + # Check `data-src` due to lazy image loading + expect(find('.js-version-status-badge', visible: false)['data-src']) + .to end_with('/version-check-url') end end |