blob: f81e8c5badf53727d6b542d22de6aa886951892d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# 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
it 'renders the free trial button' do
expect(rendered).to have_content('Get free trial')
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
|