summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-02-22 18:34:06 +0000
committerClement Ho <clemmakesapps@gmail.com>2017-02-22 18:34:06 +0000
commitfca326e5e29500c6c997a6b5e291e5e7b336dc1b (patch)
treee47231986c02fb06e523d57f407dd0d6a1ddbaa8 /spec/features
parentd2c80bf3507a1acade1746b9a077140f5db5710e (diff)
parentbb483230e60692e203775346ac3ad4407e3864a5 (diff)
downloadgitlab-ce-fca326e5e29500c6c997a6b5e291e5e7b336dc1b.tar.gz
Merge branch 'gamesover/gitlab-ce-broken_iamge_when_doing_offline_update_check(help_page)' into 'master'
Gamesover/gitlab ce broken iamge when doing offline update check(help page) See merge request !8539
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/help_pages_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb
index 40a1fced8d8..e0b2404e60a 100644
--- a/spec/features/help_pages_spec.rb
+++ b/spec/features/help_pages_spec.rb
@@ -33,4 +33,30 @@ describe 'Help Pages', feature: true do
it_behaves_like 'help page', prefix: '/gitlab'
end
end
+
+ context 'in a production environment with version check enabled', js: true do
+ before do
+ allow(Rails.env).to receive(:production?) { true }
+ allow(current_application_settings).to receive(:version_check_enabled) { true }
+ allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' }
+
+ login_as :user
+ visit help_path
+ end
+
+ it 'should display a version check image' do
+ expect(find('.js-version-status-badge')).to be_visible
+ 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');")
+
+ expect(find('.js-version-status-badge', visible: false)).not_to be_visible
+ end
+ end
end