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:
Diffstat (limited to 'spec/views/layouts/header/_super_sidebar_logged_out.html.haml_spec.rb')
-rw-r--r--spec/views/layouts/header/_super_sidebar_logged_out.html.haml_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/views/layouts/header/_super_sidebar_logged_out.html.haml_spec.rb b/spec/views/layouts/header/_super_sidebar_logged_out.html.haml_spec.rb
new file mode 100644
index 00000000000..89a03d72a90
--- /dev/null
+++ b/spec/views/layouts/header/_super_sidebar_logged_out.html.haml_spec.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'layouts/header/_super_sidebar_logged_out', feature_category: :navigation do
+ before do
+ allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(nil))
+ Feature.enable(:super_sidebar_logged_out)
+ end
+
+ context 'on gitlab.com' do
+ before do
+ allow(Gitlab).to receive(:com?).and_return(true)
+ render
+ end
+
+ it 'renders marketing links' do
+ expect(rendered).to have_content('Why GitLab')
+ expect(rendered).to have_content('Pricing')
+ expect(rendered).to have_content('Contact Sales')
+ end
+ end
+
+ context 'on self-managed' do
+ it 'does not render marketing links' do
+ render
+ expect(rendered).not_to have_content('Why GitLab')
+ expect(rendered).not_to have_content('Pricing')
+ expect(rendered).not_to have_content('Contact Sales')
+ end
+ end
+
+ it 'renders links to Explore and Sign-in and Register' do
+ render
+ expect(rendered).to have_content('Explore')
+ expect(rendered).to have_content('Sign in')
+ expect(rendered).to have_content('Register')
+ end
+end