diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/frontend/fixtures/startup_css.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/frontend/fixtures/startup_css.rb')
-rw-r--r-- | spec/frontend/fixtures/startup_css.rb | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/spec/frontend/fixtures/startup_css.rb b/spec/frontend/fixtures/startup_css.rb new file mode 100644 index 00000000000..003f7b768dd --- /dev/null +++ b/spec/frontend/fixtures/startup_css.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Startup CSS fixtures', type: :controller do + include JavaScriptFixturesHelpers + + let(:use_full_html) { true } + + render_views + + before(:all) do + stub_feature_flags(combined_menu: true) + stub_feature_flags(sidebar_refactor: true) + clean_frontend_fixtures('startup_css/') + end + + shared_examples 'startup css project fixtures' do |type| + let(:user) { create(:user, :admin) } + let(:project) { create(:project, :public, :repository, description: 'Code and stuff', creator: user) } + + before do + sign_in(user) + end + + it "startup_css/project-#{type}-legacy-menu.html" do + stub_feature_flags(combined_menu: false) + + get :show, params: { + namespace_id: project.namespace.to_param, + id: project + } + + expect(response).to be_successful + end + + it "startup_css/project-#{type}.html" do + get :show, params: { + namespace_id: project.namespace.to_param, + id: project + } + + expect(response).to be_successful + end + + it "startup_css/project-#{type}-legacy-sidebar.html" do + stub_feature_flags(sidebar_refactor: false) + + get :show, params: { + namespace_id: project.namespace.to_param, + id: project + } + + expect(response).to be_successful + end + + it "startup_css/project-#{type}-signed-out.html" do + sign_out(user) + + get :show, params: { + namespace_id: project.namespace.to_param, + id: project + } + + expect(response).to be_successful + end + end + + describe ProjectsController, '(Startup CSS fixtures)', type: :controller do + it_behaves_like 'startup css project fixtures', 'general' + end + + describe ProjectsController, '(Startup CSS fixtures)', type: :controller do + before do + user.update!(theme_id: 11) + end + + it_behaves_like 'startup css project fixtures', 'dark' + end + + describe RegistrationsController, '(Startup CSS fixtures)', type: :controller do + it 'startup_css/sign-in.html' do + get :new + + expect(response).to be_successful + end + end +end |