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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-03 03:06:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-03 03:06:28 +0300
commit10d0e5693c0eed9fd9c40f4fadeda187237db6b5 (patch)
tree82a723f14e4a44146c7c5e2259b9c7d6d9b834bb /spec/views
parenta19a376bf35b2009566e86b8190662c21ed7e2ba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/layouts/application.html.haml_spec.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/spec/views/layouts/application.html.haml_spec.rb b/spec/views/layouts/application.html.haml_spec.rb
new file mode 100644
index 00000000000..bdd4a97a1f5
--- /dev/null
+++ b/spec/views/layouts/application.html.haml_spec.rb
@@ -0,0 +1,47 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'layouts/application' do
+ let(:user) { create(:user) }
+
+ before do
+ allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
+ allow(view).to receive(:experiment_enabled?).and_return(false)
+ allow(view).to receive(:session).and_return({})
+ allow(view).to receive(:user_signed_in?).and_return(true)
+ allow(view).to receive(:current_user).and_return(user)
+ end
+
+ context 'body data elements for pageview context' do
+ let(:body_data) do
+ {
+ body_data_page: 'projects:issues:show',
+ body_data_page_type_id: '1',
+ body_data_project_id: '2',
+ body_data_namespace_id: '3'
+ }
+ end
+
+ before do
+ allow(view).to receive(:body_data).and_return(body_data)
+ render
+ end
+
+ it 'includes the body element page' do
+ expect(rendered).to include('data-page="projects:issues:show"')
+ end
+
+ it 'includes the body element page_type_id' do
+ expect(rendered).to include('data-page-type-id="1"')
+ end
+
+ it 'includes the body element project_id' do
+ expect(rendered).to include('data-project-id="2"')
+ end
+
+ it 'includes the body element namespace_id' do
+ expect(rendered).to include('data-namespace-id="3"')
+ end
+ end
+end