Commit 0c469979 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '6535-extract-ee-specific-files-lines-for-spec-views' into 'master'

Extract EE specific files/lines for spec/views

Closes #6535

See merge request gitlab-org/gitlab-ee!10581
parents bf852074 39f4e8ab
require 'spec_helper'
describe 'layouts/_head' do
before do
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
end
context 'when an asset_host is set and snowplow url is set' do
let(:asset_host) { 'http://test.host' }
before do
allow(ActionController::Base).to receive(:asset_host).and_return(asset_host)
allow(Gitlab::CurrentSettings).to receive(:snowplow_enabled?).and_return(true)
allow(Gitlab::CurrentSettings).to receive(:snowplow_collector_uri).and_return('www.snow.plow')
end
it 'add a snowplow script tag with asset host' do
render
expect(rendered).to match('http://test.host/assets/snowplow/')
expect(rendered).to match('window.snowplow')
expect(rendered).to match('www.snow.plow')
end
end
end
......@@ -13,6 +13,18 @@ describe 'layouts/nav/sidebar/_project' do
stub_licensed_features(tracing: true)
end
describe 'issue boards' do
it 'has board tab when multiple issue boards is not available' do
allow(view).to receive(:can?).and_return(true)
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:multiple_project_issue_boards) { false }
render
expect(rendered).to have_css('a[title="Board"]')
end
end
describe 'Operations main link' do
let(:user) { create(:user) }
......
......@@ -62,21 +62,12 @@ describe 'layouts/_head' do
end
end
context 'when an asset_host is set and snowplow url is set' do
let(:asset_host) { 'http://test.host' }
it 'adds selected syntax highlight stylesheet' do
allow_any_instance_of(PreferencesHelper).to receive(:user_color_scheme).and_return("solarised-light")
before do
allow(ActionController::Base).to receive(:asset_host).and_return(asset_host)
allow(Gitlab::CurrentSettings).to receive(:snowplow_enabled?).and_return(true)
allow(Gitlab::CurrentSettings).to receive(:snowplow_collector_uri).and_return('www.snow.plow')
end
render
it 'add a snowplow script tag with asset host' do
render
expect(rendered).to match('http://test.host/assets/snowplow/')
expect(rendered).to match('window.snowplow')
expect(rendered).to match('www.snow.plow')
end
expect(rendered).to match('<link rel="stylesheet" media="all" href="/stylesheets/highlight/themes/solarised-light.css" />')
end
def stub_helper_with_safe_string(method)
......
......@@ -19,15 +19,6 @@ describe 'layouts/nav/sidebar/_project' do
expect(rendered).to have_css('a[title="Boards"]')
end
it 'has board tab when multiple issue boards is not available' do
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:multiple_project_issue_boards) { false }
render
expect(rendered).to have_css('a[title="Board"]')
end
end
describe 'container registry tab' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment