[go: up one dir, main page]

Skip to content

Extract EE specific files/lines for spec/views

We have the following files containing EE specific code. We should move them to ee/

spec/views/layouts/_head.html.haml_spec.rb
diff --git a/spec/views/layouts/_head.html.haml_spec.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/views/layouts/_head.html.haml_spec.rb
index cbb4199954a..41d2fa5b91e 100644
--- a/spec/views/layouts/_head.html.haml_spec.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/views/layouts/_head.html.haml_spec.rb
@@ -62,12 +62,21 @@ describe 'layouts/_head' do
     end
   end
 
-  it 'adds selected syntax highlight stylesheet' do
-    allow_any_instance_of(PreferencesHelper).to receive(:user_color_scheme).and_return("solarised-light")
+  context 'when an asset_host is set and snowplow url is set' do
+    let(:asset_host) { 'http://test.host' }
 
-    render
+    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
 
-    expect(rendered).to match('<link rel="stylesheet" media="all" href="/stylesheets/highlight/themes/solarised-light.css" />')
+    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
 
   def stub_helper_with_safe_string(method)
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
index d9f05e5f94f..6d0628d6012 100644
--- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
@@ -15,6 +15,15 @@ describe 'layouts/nav/sidebar/_project' do
     it 'has board tab' do
       render
 
+      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

Marking as discussion because there's a difference regarding issue boards.

Edited by Yorick Peterse