diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-12-13 15:54:06 +0000 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2019-12-13 15:54:06 +0000 |
commit | fe022014e790b221f49a96dde5d5b7dfb4bf10bc (patch) | |
tree | 0b12e4f79ee8fa851e3f3587bebe3b9b6aa20822 /spec | |
parent | a21e41126b4430cfdde3ba19fcf29eb1b945967b (diff) | |
download | gitlab-ce-fe022014e790b221f49a96dde5d5b7dfb4bf10bc.tar.gz |
Revert "Add latest changes from gitlab-org/gitlab@12-0-stable-ee"
This reverts commit a21e41126b4430cfdde3ba19fcf29eb1b945967b
Diffstat (limited to 'spec')
49 files changed, 160 insertions, 516 deletions
diff --git a/spec/controllers/oauth/applications_controller_spec.rb b/spec/controllers/oauth/applications_controller_spec.rb index df836c2c3e3..228c97d591d 100644 --- a/spec/controllers/oauth/applications_controller_spec.rb +++ b/spec/controllers/oauth/applications_controller_spec.rb @@ -17,7 +17,7 @@ describe Oauth::ApplicationsController do expect(response).to have_gitlab_http_status(200) end - it 'redirects back to profile page if OAuth applications are disabled' do + it 'shows list of applications' do disable_user_oauth get :index diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb index 1c3ada0dfa5..4141e41c7a7 100644 --- a/spec/controllers/projects/project_members_controller_spec.rb +++ b/spec/controllers/projects/project_members_controller_spec.rb @@ -4,8 +4,7 @@ require('spec_helper') describe Projects::ProjectMembersController do let(:user) { create(:user) } - let(:project) { create(:project, :public, :access_requestable, namespace: namespace) } - let(:namespace) { create :group } + let(:project) { create(:project, :public, :access_requestable) } describe 'GET index' do it 'has the project_members address with a 200 status code' do @@ -316,13 +315,6 @@ describe Projects::ProjectMembersController do end describe 'POST apply_import' do - subject(:apply_import) do - post(:apply_import, params: { - namespace_id: project.namespace, - project_id: project, - source_project_id: another_project.id - }) - end let(:another_project) { create(:project, :private) } let(:member) { create(:user) } @@ -332,44 +324,40 @@ describe Projects::ProjectMembersController do sign_in(user) end + shared_context 'import applied' do + before do + post(:apply_import, params: { + namespace_id: project.namespace, + project_id: project, + source_project_id: another_project.id + }) + end + end + context 'when user can access source project members' do before do another_project.add_guest(user) end - it 'imports source project members' do - apply_import + include_context 'import applied' + it 'imports source project members' do expect(project.team_members).to include member expect(response).to set_flash.to 'Successfully imported' expect(response).to redirect_to( project_project_members_path(project) ) end - - context 'and the project group has membership lock enabled' do - before do - project.namespace.update(membership_lock: true) - end - - it 'responds with 403' do - apply_import - - expect(response.status).to eq 403 - end - end end context 'when user is not member of a source project' do - it 'does not import team members' do - apply_import + include_context 'import applied' + it 'does not import team members' do expect(project.team_members).not_to include member end it 'responds with not found' do - apply_import - expect(response.status).to eq 404 end end @@ -377,78 +365,40 @@ describe Projects::ProjectMembersController do describe 'POST create' do let(:stranger) { create(:user) } - subject(:create_member) do - post :create, params: { - user_ids: stranger.id, - namespace_id: project.namespace, - access_level: access_level, - project_id: project - } - end - let(:access_level) { nil } - - before do - project.add_maintainer(user) - sign_in(user) - end context 'when creating owner' do - let(:access_level) { Member::OWNER } - - it 'does not create a member' do - expect { create_member }.not_to change { project.members.count } - end - end - - context 'when create maintainer' do - let(:access_level) { Member::MAINTAINER } - - it 'creates a member' do - expect { create_member }.to change { project.members.count }.by(1) - end - end - - context 'when project group has membership lock enabled' do before do - project.namespace.update(membership_lock: true) + project.add_maintainer(user) + sign_in(user) end - it 'responds with 403' do - create_member - - expect(response.status).to eq 403 + it 'does not create a member' do + expect do + post :create, params: { + user_ids: stranger.id, + namespace_id: project.namespace, + access_level: Member::OWNER, + project_id: project + } + end.to change { project.members.count }.by(0) end end - end - - describe 'GET import' do - subject(:import) do - get :import, params: { - namespace_id: project.namespace, - project_id: project - } - end - - before do - project.add_maintainer(user) - sign_in(user) - end - - it 'responds with 200' do - import - expect(response.status).to eq 200 - end - - context 'when project group has membership lock enabled' do + context 'when create maintainer' do before do - project.namespace.update(membership_lock: true) + project.add_maintainer(user) + sign_in(user) end - it 'responds with 403' do - import - - expect(response.status).to eq 403 + it 'creates a member' do + expect do + post :create, params: { + user_ids: stranger.id, + namespace_id: project.namespace, + access_level: Member::MAINTAINER, + project_id: project + } + end.to change { project.members.count }.by(1) end end end diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index 74b2f7ebfed..6cfec5f4017 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -1,16 +1,12 @@ # frozen_string_literal: true require 'spec_helper' -require Rails.root.join('ee', 'spec', 'db', 'schema_support') describe 'Database schema' do - prepend ::EE::DB::SchemaSupport - let(:connection) { ActiveRecord::Base.connection } let(:tables) { connection.tables } # Use if you are certain that this column should not have a foreign key - # EE: edit the ee/spec/db/schema_support.rb IGNORED_FK_COLUMNS = { abuse_reports: %w[reporter_id user_id], application_settings: %w[performance_bar_allowed_group_id slack_app_id snowplow_site_id], diff --git a/spec/factories/ci/bridge.rb b/spec/factories/ci/bridge.rb index 7cb5900f2b7..b1d82b98411 100644 --- a/spec/factories/ci/bridge.rb +++ b/spec/factories/ci/bridge.rb @@ -1,6 +1,6 @@ FactoryBot.define do factory :ci_bridge, class: Ci::Bridge do - name 'bridge' + name ' bridge' stage 'test' stage_idx 0 ref 'master' diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index ddabb284abe..5b4d0f7ca3f 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -273,7 +273,6 @@ describe 'Admin updates settings' do expect(Gitlab::CurrentSettings.recaptcha_enabled).to be true expect(Gitlab::CurrentSettings.login_recaptcha_protection_enabled).to be true expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15) - expect(Gitlab::CurrentSettings.login_recaptcha_protection_enabled).to be true end end diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb index 0c1e1d5910b..0c6713f623c 100644 --- a/spec/features/dashboard/merge_requests_spec.rb +++ b/spec/features/dashboard/merge_requests_spec.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'spec_helper' describe 'Dashboard Merge Requests' do diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index e2100c8562b..d1ed64cce7f 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'spec_helper' describe 'Dashboard Projects' do diff --git a/spec/features/dashboard/todos/todos_filtering_spec.rb b/spec/features/dashboard/todos/todos_filtering_spec.rb index 3ea42748936..85f865321cf 100644 --- a/spec/features/dashboard/todos/todos_filtering_spec.rb +++ b/spec/features/dashboard/todos/todos_filtering_spec.rb @@ -4,36 +4,23 @@ describe 'Dashboard > User filters todos', :js do let(:user_1) { create(:user, username: 'user_1', name: 'user_1') } let(:user_2) { create(:user, username: 'user_2', name: 'user_2') } - let(:group1) { create(:group) } - let(:group2) { create(:group) } + let(:project_1) { create(:project, name: 'project_1') } + let(:project_2) { create(:project, name: 'project_2') } - let(:project_1) { create(:project, name: 'project_1', namespace: group1) } - let(:project_2) { create(:project, name: 'project_2', namespace: group1) } - let(:project_3) { create(:project, name: 'project_3', namespace: group2) } - - let(:issue1) { create(:issue, title: 'issue', project: project_1) } - let(:issue2) { create(:issue, title: 'issue', project: project_3) } + let(:issue) { create(:issue, title: 'issue', project: project_1) } let!(:merge_request) { create(:merge_request, source_project: project_2, title: 'merge_request') } before do - create(:todo, user: user_1, author: user_2, project: project_1, target: issue1, action: 1) - create(:todo, user: user_1, author: user_2, project: project_3, target: issue2, action: 1) + create(:todo, user: user_1, author: user_2, project: project_1, target: issue, action: 1) create(:todo, user: user_1, author: user_1, project: project_2, target: merge_request, action: 2) project_1.add_developer(user_1) project_2.add_developer(user_1) - project_3.add_developer(user_1) sign_in(user_1) visit dashboard_todos_path end - it 'displays all todos without a filter' do - expect(page).to have_content issue1.to_reference(full: true) - expect(page).to have_content merge_request.to_reference(full: true) - expect(page).to have_content issue2.to_reference(full: true) - end - it 'filters by project' do click_button 'Project' within '.dropdown-menu-project' do @@ -47,20 +34,6 @@ describe 'Dashboard > User filters todos', :js do expect(page).not_to have_content project_2.full_name end - it 'filters by group' do - click_button 'Group' - within '.dropdown-menu-group' do - fill_in 'Search groups', with: group1.full_name - click_link group1.full_name - end - - wait_for_requests - - expect(page).to have_content issue1.to_reference(full: true) - expect(page).to have_content merge_request.to_reference(full: true) - expect(page).not_to have_content issue2.to_reference(full: true) - end - context 'Author filter' do it 'filters by author' do click_button 'Author' @@ -90,7 +63,7 @@ describe 'Dashboard > User filters todos', :js do it 'shows only authors of existing done todos' do user_3 = create :user user_4 = create :user - create(:todo, user: user_1, author: user_3, project: project_1, target: issue1, action: 1, state: :done) + create(:todo, user: user_1, author: user_3, project: project_1, target: issue, action: 1, state: :done) create(:todo, user: user_1, author: user_4, project: project_2, target: merge_request, action: 2, state: :done) project_1.add_developer(user_3) @@ -119,15 +92,14 @@ describe 'Dashboard > User filters todos', :js do wait_for_requests - expect(find('.todos-list')).to have_content issue1.to_reference - expect(find('.todos-list')).to have_content issue2.to_reference + expect(find('.todos-list')).to have_content issue.to_reference expect(find('.todos-list')).not_to have_content merge_request.to_reference end describe 'filter by action' do before do create(:todo, :build_failed, user: user_1, author: user_2, project: project_1) - create(:todo, :marked, user: user_1, author: user_2, project: project_1, target: issue1) + create(:todo, :marked, user: user_1, author: user_2, project: project_1, target: issue) end it 'filters by Assigned' do diff --git a/spec/features/protected_tags_spec.rb b/spec/features/protected_tags_spec.rb index 7b9dde29ce9..652542b1719 100644 --- a/spec/features/protected_tags_spec.rb +++ b/spec/features/protected_tags_spec.rb @@ -14,7 +14,6 @@ describe 'Protected Tags', :js do it "allows creating explicit protected tags" do visit project_protected_tags_path(project) set_protected_tag_name('some-tag') - set_allowed_to('create') click_on "Protect" within(".protected-tags-list") { expect(page).to have_content('some-tag') } @@ -28,7 +27,6 @@ describe 'Protected Tags', :js do visit project_protected_tags_path(project) set_protected_tag_name('some-tag') - set_allowed_to('create') click_on "Protect" within(".protected-tags-list") { expect(page).to have_content(commit.id[0..7]) } @@ -37,7 +35,6 @@ describe 'Protected Tags', :js do it "displays an error message if the named tag does not exist" do visit project_protected_tags_path(project) set_protected_tag_name('some-tag') - set_allowed_to('create') click_on "Protect" within(".protected-tags-list") { expect(page).to have_content('tag was removed') } @@ -48,7 +45,6 @@ describe 'Protected Tags', :js do it "allows creating protected tags with a wildcard" do visit project_protected_tags_path(project) set_protected_tag_name('*-stable') - set_allowed_to('create') click_on "Protect" within(".protected-tags-list") { expect(page).to have_content('*-stable') } @@ -62,7 +58,6 @@ describe 'Protected Tags', :js do visit project_protected_tags_path(project) set_protected_tag_name('*-stable') - set_allowed_to('create') click_on "Protect" within(".protected-tags-list") do @@ -78,7 +73,6 @@ describe 'Protected Tags', :js do visit project_protected_tags_path(project) set_protected_tag_name('*-stable') - set_allowed_to('create') click_on "Protect" visit project_protected_tags_path(project) diff --git a/spec/features/security/profile_access_spec.rb b/spec/features/security/profile_access_spec.rb index 9fa5ae0df7d..044a47567be 100644 --- a/spec/features/security/profile_access_spec.rb +++ b/spec/features/security/profile_access_spec.rb @@ -10,7 +10,6 @@ describe "Profile access" do it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :user } - it { is_expected.to be_allowed_for :auditor } it { is_expected.to be_denied_for :visitor } end @@ -19,7 +18,6 @@ describe "Profile access" do it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :user } - it { is_expected.to be_allowed_for :auditor } it { is_expected.to be_denied_for :visitor } end @@ -28,7 +26,6 @@ describe "Profile access" do it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :user } - it { is_expected.to be_allowed_for :auditor } it { is_expected.to be_denied_for :visitor } end @@ -37,7 +34,6 @@ describe "Profile access" do it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :user } - it { is_expected.to be_allowed_for :auditor } it { is_expected.to be_denied_for :visitor } end @@ -46,7 +42,6 @@ describe "Profile access" do it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :user } - it { is_expected.to be_allowed_for :auditor } it { is_expected.to be_denied_for :visitor } end @@ -55,7 +50,6 @@ describe "Profile access" do it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for :user } - it { is_expected.to be_allowed_for :auditor } it { is_expected.to be_denied_for :visitor } end end diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb index 65dbae1c674..f380bc122a7 100644 --- a/spec/features/security/project/private_access_spec.rb +++ b/spec/features/security/project/private_access_spec.rb @@ -126,7 +126,7 @@ describe "Private Project Access" do describe "GET /:project_path/blob" do let(:commit) { project.repository.commit } - subject { project_blob_path(project, File.join(commit.id, '.gitignore')) } + subject { project_blob_path(project, File.join(commit.id, '.gitignore'))} it { is_expected.to be_allowed_for(:admin) } it { is_expected.to be_allowed_for(:owner).of(project) } diff --git a/spec/features/tags/master_deletes_tag_spec.rb b/spec/features/tags/master_deletes_tag_spec.rb index cd8affb2702..ccd7a233fcb 100644 --- a/spec/features/tags/master_deletes_tag_spec.rb +++ b/spec/features/tags/master_deletes_tag_spec.rb @@ -49,7 +49,6 @@ describe 'Maintainer deletes tag' do def delete_tag(tag) page.within('.content') do - accept_confirm { first('.btn-remove').click } accept_confirm { find("li > .row-fixed-content.controls a.btn-remove[href='/#{project.full_path}/-/tags/#{tag}']").click } end end diff --git a/spec/features/usage_stats_consent_spec.rb b/spec/features/usage_stats_consent_spec.rb index 86da58581c5..dd8f3179895 100644 --- a/spec/features/usage_stats_consent_spec.rb +++ b/spec/features/usage_stats_consent_spec.rb @@ -8,7 +8,7 @@ describe 'Usage stats consent' do let(:message) { 'To help improve GitLab, we would like to periodically collect usage information.' } before do - allow_any_instance_of(EE::User).to receive(:has_current_license?).and_return false + allow(user).to receive(:has_current_license?).and_return false gitlab_sign_in(user) end diff --git a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/dashboard.json b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/dashboard.json index 5d779a323c2..1ee1205e29a 100644 --- a/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/dashboard.json +++ b/spec/fixtures/lib/gitlab/metrics/dashboard/schemas/dashboard.json @@ -1,10 +1,6 @@ { "type": "object", - "required": [ - "dashboard", - "priority", - "panel_groups" - ], + "required": ["dashboard", "priority", "panel_groups"], "properties": { "dashboard": { "type": "string" }, "priority": { "type": "number" }, diff --git a/spec/frontend/boards/modal_store_spec.js b/spec/frontend/boards/modal_store_spec.js index 5b5ae4b6556..4dd27e94d97 100644 --- a/spec/frontend/boards/modal_store_spec.js +++ b/spec/frontend/boards/modal_store_spec.js @@ -25,7 +25,7 @@ describe('Modal store', () => { }); issue2 = new ListIssue({ title: 'Testing', - id: 2, + id: 1, iid: 2, confidential: false, labels: [], diff --git a/spec/frontend/vue_shared/components/droplab_dropdown_button_spec.js b/spec/frontend/vue_shared/components/droplab_dropdown_button_spec.js deleted file mode 100644 index 22295721328..00000000000 --- a/spec/frontend/vue_shared/components/droplab_dropdown_button_spec.js +++ /dev/null @@ -1,136 +0,0 @@ -import { mount, createLocalVue } from '@vue/test-utils'; - -import DroplabDropdownButton from '~/vue_shared/components/droplab_dropdown_button.vue'; - -const mockActions = [ - { - title: 'Foo', - description: 'Some foo action', - }, - { - title: 'Bar', - description: 'Some bar action', - }, -]; - -const createComponent = ({ - size = '', - dropdownClass = '', - actions = mockActions, - defaultAction = 0, -}) => { - const localVue = createLocalVue(); - - return mount(DroplabDropdownButton, { - localVue, - propsData: { - size, - dropdownClass, - actions, - defaultAction, - }, - }); -}; - -describe('DroplabDropdownButton', () => { - let wrapper; - - beforeEach(() => { - wrapper = createComponent({}); - }); - - afterEach(() => { - wrapper.destroy(); - }); - - describe('data', () => { - it('contains `selectedAction` representing value of `defaultAction` prop', () => { - expect(wrapper.vm.selectedAction).toBe(0); - }); - }); - - describe('computed', () => { - describe('selectedActionTitle', () => { - it('returns string containing title of selected action', () => { - wrapper.setData({ selectedAction: 0 }); - - expect(wrapper.vm.selectedActionTitle).toBe(mockActions[0].title); - - wrapper.setData({ selectedAction: 1 }); - - expect(wrapper.vm.selectedActionTitle).toBe(mockActions[1].title); - }); - }); - - describe('buttonSizeClass', () => { - it('returns string containing button sizing class based on `size` prop', done => { - const wrapperWithSize = createComponent({ - size: 'sm', - }); - - wrapperWithSize.vm.$nextTick(() => { - expect(wrapperWithSize.vm.buttonSizeClass).toBe('btn-sm'); - - done(); - wrapperWithSize.destroy(); - }); - }); - }); - }); - - describe('methods', () => { - describe('handlePrimaryActionClick', () => { - it('emits `onActionClick` event on component with selectedAction object as param', () => { - jest.spyOn(wrapper.vm, '$emit'); - - wrapper.setData({ selectedAction: 0 }); - wrapper.vm.handlePrimaryActionClick(); - - expect(wrapper.vm.$emit).toHaveBeenCalledWith('onActionClick', mockActions[0]); - }); - }); - - describe('handleActionClick', () => { - it('emits `onActionSelect` event on component with selectedAction index as param', () => { - jest.spyOn(wrapper.vm, '$emit'); - - wrapper.vm.handleActionClick(1); - - expect(wrapper.vm.$emit).toHaveBeenCalledWith('onActionSelect', 1); - }); - }); - }); - - describe('template', () => { - it('renders default action button', () => { - const defaultButton = wrapper.findAll('.btn').at(0); - - expect(defaultButton.text()).toBe(mockActions[0].title); - }); - - it('renders dropdown button', () => { - const dropdownButton = wrapper.findAll('.dropdown-toggle').at(0); - - expect(dropdownButton.isVisible()).toBe(true); - }); - - it('renders dropdown actions', () => { - const dropdownActions = wrapper.findAll('.dropdown-menu li button'); - - Array(dropdownActions.length) - .fill() - .forEach((_, index) => { - const actionContent = dropdownActions.at(index).find('.description'); - - expect(actionContent.find('strong').text()).toBe(mockActions[index].title); - expect(actionContent.find('p').text()).toBe(mockActions[index].description); - }); - }); - - it('renders divider between dropdown actions', () => { - const dropdownDivider = wrapper.find('.dropdown-menu .divider'); - - expect(dropdownDivider.isVisible()).toBe(true); - }); - }); -}); diff --git a/spec/javascripts/fixtures/projects.rb b/spec/javascripts/fixtures/projects.rb index b76f36b306c..94c59207898 100644 --- a/spec/javascripts/fixtures/projects.rb +++ b/spec/javascripts/fixtures/projects.rb @@ -18,9 +18,6 @@ describe 'Projects (JavaScript fixtures)', type: :controller do end before do - # EE-specific start - stub_licensed_features(variable_environment_scope: true) - # EE specific end project.add_maintainer(admin) sign_in(admin) allow(SecureRandom).to receive(:hex).and_return('securerandomhex:thereisnospoon') diff --git a/spec/javascripts/issue_show/components/title_spec.js b/spec/javascripts/issue_show/components/title_spec.js index d6dcdbb6c8e..9754c8a6755 100644 --- a/spec/javascripts/issue_show/components/title_spec.js +++ b/spec/javascripts/issue_show/components/title_spec.js @@ -68,7 +68,7 @@ describe('Title component', () => { }); }); - describe('show inline edit button', () => { + describe('inline edit button', () => { beforeEach(() => { spyOn(eventHub, '$emit'); }); diff --git a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js index 30e0504e4e1..ac2fb16bd10 100644 --- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js +++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js @@ -473,7 +473,7 @@ describe('mrWidgetOptions', () => { vm.mr.relatedLinks = { assignToMe: null, closing: ` - <a class="close-related-link" href="#"> + <a class="close-related-link" href="#'> Close </a> `, diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb index 8068a0e8384..e0552ae8c57 100644 --- a/spec/lib/gitlab/ci/config/entry/job_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb @@ -138,46 +138,6 @@ describe Gitlab::Ci::Config::Entry::Job do end end - context 'when parallel value is not correct' do - context 'when it is not a numeric value' do - let(:config) { { parallel: true } } - - it 'returns error about invalid type' do - expect(entry).not_to be_valid - expect(entry.errors).to include 'job parallel is not a number' - end - end - - context 'when it is lower than two' do - let(:config) { { parallel: 1 } } - - it 'returns error about value too low' do - expect(entry).not_to be_valid - expect(entry.errors) - .to include 'job parallel must be greater than or equal to 2' - end - end - - context 'when it is bigger than 50' do - let(:config) { { parallel: 51 } } - - it 'returns error about value too high' do - expect(entry).not_to be_valid - expect(entry.errors) - .to include 'job parallel must be less than or equal to 50' - end - end - - context 'when it is not an integer' do - let(:config) { { parallel: 1.5 } } - - it 'returns error about wrong value' do - expect(entry).not_to be_valid - expect(entry.errors).to include 'job parallel must be an integer' - end - end - end - context 'when delayed job' do context 'when start_in is specified' do let(:config) { { script: 'echo', when: 'delayed', start_in: '1 day' } } diff --git a/spec/lib/gitlab/git_ref_validator_spec.rb b/spec/lib/gitlab/git_ref_validator_spec.rb index 6fc41cd64f9..b63389af29f 100644 --- a/spec/lib/gitlab/git_ref_validator_spec.rb +++ b/spec/lib/gitlab/git_ref_validator_spec.rb @@ -4,66 +4,66 @@ describe Gitlab::GitRefValidator do using RSpec::Parameterized::TableSyntax context '.validate' do - it { expect(described_class.validate('feature/new')).to be_truthy } - it { expect(described_class.validate('implement_@all')).to be_truthy } - it { expect(described_class.validate('my_new_feature')).to be_truthy } - it { expect(described_class.validate('my-branch')).to be_truthy } - it { expect(described_class.validate('#1')).to be_truthy } - it { expect(described_class.validate('feature/refs/heads/foo')).to be_truthy } - it { expect(described_class.validate('feature/~new/')).to be_falsey } - it { expect(described_class.validate('feature/^new/')).to be_falsey } - it { expect(described_class.validate('feature/:new/')).to be_falsey } - it { expect(described_class.validate('feature/?new/')).to be_falsey } - it { expect(described_class.validate('feature/*new/')).to be_falsey } - it { expect(described_class.validate('feature/[new/')).to be_falsey } - it { expect(described_class.validate('feature/new/')).to be_falsey } - it { expect(described_class.validate('feature/new.')).to be_falsey } - it { expect(described_class.validate('feature\@{')).to be_falsey } - it { expect(described_class.validate('feature\new')).to be_falsey } - it { expect(described_class.validate('feature//new')).to be_falsey } - it { expect(described_class.validate('feature new')).to be_falsey } - it { expect(described_class.validate('refs/heads/')).to be_falsey } - it { expect(described_class.validate('refs/remotes/')).to be_falsey } - it { expect(described_class.validate('refs/heads/feature')).to be_falsey } - it { expect(described_class.validate('refs/remotes/origin')).to be_falsey } - it { expect(described_class.validate('-')).to be_falsey } - it { expect(described_class.validate('-branch')).to be_falsey } - it { expect(described_class.validate('+foo:bar')).to be_falsey } - it { expect(described_class.validate('foo:bar')).to be_falsey } - it { expect(described_class.validate('.tag')).to be_falsey } - it { expect(described_class.validate('my branch')).to be_falsey } - it { expect(described_class.validate("\xA0\u0000\xB0")).to be_falsey } + it { expect(described_class.validate('feature/new')).to be true } + it { expect(described_class.validate('implement_@all')).to be true } + it { expect(described_class.validate('my_new_feature')).to be true } + it { expect(described_class.validate('my-branch')).to be true } + it { expect(described_class.validate('#1')).to be true } + it { expect(described_class.validate('feature/refs/heads/foo')).to be true } + it { expect(described_class.validate('feature/~new/')).to be false } + it { expect(described_class.validate('feature/^new/')).to be false } + it { expect(described_class.validate('feature/:new/')).to be false } + it { expect(described_class.validate('feature/?new/')).to be false } + it { expect(described_class.validate('feature/*new/')).to be false } + it { expect(described_class.validate('feature/[new/')).to be false } + it { expect(described_class.validate('feature/new/')).to be false } + it { expect(described_class.validate('feature/new.')).to be false } + it { expect(described_class.validate('feature\@{')).to be false } + it { expect(described_class.validate('feature\new')).to be false } + it { expect(described_class.validate('feature//new')).to be false } + it { expect(described_class.validate('feature new')).to be false } + it { expect(described_class.validate('refs/heads/')).to be false } + it { expect(described_class.validate('refs/remotes/')).to be false } + it { expect(described_class.validate('refs/heads/feature')).to be false } + it { expect(described_class.validate('refs/remotes/origin')).to be false } + it { expect(described_class.validate('-')).to be false } + it { expect(described_class.validate('-branch')).to be false } + it { expect(described_class.validate('+foo:bar')).to be false } + it { expect(described_class.validate('foo:bar')).to be false } + it { expect(described_class.validate('.tag')).to be false } + it { expect(described_class.validate('my branch')).to be false } + it { expect(described_class.validate("\xA0\u0000\xB0")).to be false } end context '.validate_merge_request_branch' do - it { expect(described_class.validate_merge_request_branch('HEAD')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('feature/new')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('implement_@all')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('my_new_feature')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('my-branch')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('#1')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('feature/refs/heads/foo')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('feature/~new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/^new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/:new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/?new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/*new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/[new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/new/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature/new.')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature\@{')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature\new')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature//new')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('feature new')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('refs/heads/master')).to be_truthy } - it { expect(described_class.validate_merge_request_branch('refs/heads/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('refs/remotes/')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('-')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('-branch')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('+foo:bar')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('foo:bar')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('.tag')).to be_falsey } - it { expect(described_class.validate_merge_request_branch('my branch')).to be_falsey } - it { expect(described_class.validate_merge_request_branch("\xA0\u0000\xB0")).to be_falsey } + it { expect(described_class.validate_merge_request_branch('HEAD')).to be true } + it { expect(described_class.validate_merge_request_branch('feature/new')).to be true } + it { expect(described_class.validate_merge_request_branch('implement_@all')).to be true } + it { expect(described_class.validate_merge_request_branch('my_new_feature')).to be true } + it { expect(described_class.validate_merge_request_branch('my-branch')).to be true } + it { expect(described_class.validate_merge_request_branch('#1')).to be true } + it { expect(described_class.validate_merge_request_branch('feature/refs/heads/foo')).to be true } + it { expect(described_class.validate_merge_request_branch('feature/~new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/^new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/:new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/?new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/*new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/[new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/new/')).to be false } + it { expect(described_class.validate_merge_request_branch('feature/new.')).to be false } + it { expect(described_class.validate_merge_request_branch('feature\@{')).to be false } + it { expect(described_class.validate_merge_request_branch('feature\new')).to be false } + it { expect(described_class.validate_merge_request_branch('feature//new')).to be false } + it { expect(described_class.validate_merge_request_branch('feature new')).to be false } + it { expect(described_class.validate_merge_request_branch('refs/heads/master')).to be true } + it { expect(described_class.validate_merge_request_branch('refs/heads/')).to be false } + it { expect(described_class.validate_merge_request_branch('refs/remotes/')).to be false } + it { expect(described_class.validate_merge_request_branch('-')).to be false } + it { expect(described_class.validate_merge_request_branch('-branch')).to be false } + it { expect(described_class.validate_merge_request_branch('+foo:bar')).to be false } + it { expect(described_class.validate_merge_request_branch('foo:bar')).to be false } + it { expect(described_class.validate_merge_request_branch('.tag')).to be false } + it { expect(described_class.validate_merge_request_branch('my branch')).to be false } + it { expect(described_class.validate_merge_request_branch("\xA0\u0000\xB0")).to be false } end end diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index d3e0316c4fe..7a250603b6b 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -343,6 +343,7 @@ project: - fork_network_member - fork_network - custom_attributes +- prometheus_metrics - lfs_file_locks - project_badges - source_of_merge_requests diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 26de374c855..6512fe80a3b 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -2775,8 +2775,7 @@ "action": 1, "author_id": 1 } - ], - "approvals_before_merge": 1 + ] }, { "id": 26, diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb index 5f56c30c7e0..bc4f867e891 100644 --- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb @@ -42,10 +42,6 @@ describe Gitlab::ImportExport::ProjectTreeSaver do expect(saved_project_json).to include({ 'description' => 'description', 'visibility_level' => 20 }) end - it 'has approvals_before_merge set' do - expect(saved_project_json['approvals_before_merge']).to eq(1) - end - it 'has milestones' do expect(saved_project_json['milestones']).not_to be_empty end @@ -291,8 +287,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do issues: [issue], snippets: [snippet], releases: [release], - group: group, - approvals_before_merge: 1 + group: group ) project_label = create(:label, project: project) group_label = create(:group_label, group: group) diff --git a/spec/lib/gitlab/object_hierarchy_spec.rb b/spec/lib/gitlab/object_hierarchy_spec.rb index 4154f9cbe80..e6e9ae3223e 100644 --- a/spec/lib/gitlab/object_hierarchy_spec.rb +++ b/spec/lib/gitlab/object_hierarchy_spec.rb @@ -145,20 +145,6 @@ describe Gitlab::ObjectHierarchy, :postgresql do end end - describe '#root' do - it 'includes only the roots' do - relation = described_class.new(Group.where(id: child2)).roots - - expect(relation).to contain_exactly(parent) - end - - it 'when quering parent it includes parent' do - relation = described_class.new(Group.where(id: parent)).roots - - expect(relation).to contain_exactly(parent) - end - end - describe '#all_objects' do let(:relation) do described_class.new(Group.where(id: child1.id)).all_objects diff --git a/spec/lib/gitlab/search_results_spec.rb b/spec/lib/gitlab/search_results_spec.rb index cc029038108..3d27156b356 100644 --- a/spec/lib/gitlab/search_results_spec.rb +++ b/spec/lib/gitlab/search_results_spec.rb @@ -272,6 +272,7 @@ describe Gitlab::SearchResults do milestone_1 = create(:milestone, project: private_project_1, title: 'Private project with access milestone', state: 'closed') milestone_2 = create(:milestone, project: internal_project, title: 'Internal project milestone') milestone_3 = create(:milestone, project: public_project_1, title: 'Public project with milestones enabled milestone') + # Global search scope takes user authorized projects, internal projects and public projects. limit_projects = ProjectsFinder.new(current_user: user).execute milestones = described_class.new(user, limit_projects, 'milestone').objects('milestones') diff --git a/spec/lib/gitlab/sidekiq_config_spec.rb b/spec/lib/gitlab/sidekiq_config_spec.rb index 9c83af740b7..0c66d764851 100644 --- a/spec/lib/gitlab/sidekiq_config_spec.rb +++ b/spec/lib/gitlab/sidekiq_config_spec.rb @@ -21,4 +21,25 @@ describe Gitlab::SidekiqConfig do expect(queues).to include('default') end end + + describe '.expand_queues' do + it 'expands queue namespaces to concrete queue names' do + queues = described_class.expand_queues(%w[cronjob]) + + expect(queues).to include('cronjob:stuck_import_jobs') + expect(queues).to include('cronjob:stuck_merge_jobs') + end + + it 'lets concrete queue names pass through' do + queues = described_class.expand_queues(%w[post_receive]) + + expect(queues).to include('post_receive') + end + + it 'lets unknown queues pass through' do + queues = described_class.expand_queues(%w[unknown]) + + expect(queues).to include('unknown') + end + end end diff --git a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb index 52e100768a7..5f0a7e925ca 100644 --- a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb +++ b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'spec_helper' describe Gitlab::Template::GitlabCiYmlTemplate do diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 3aa30f28604..c6251326c22 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -193,6 +193,7 @@ describe MergeRequest do with_them do it "validates source_branch" do subject = build(:merge_request, source_branch: branch_name, target_branch: 'master') + subject.valid? expect(subject.errors.added?(:source_branch)).to eq(!valid) @@ -200,6 +201,7 @@ describe MergeRequest do it "validates target_branch" do subject = build(:merge_request, source_branch: 'master', target_branch: branch_name) + subject.valid? expect(subject.errors.added?(:target_branch)).to eq(!valid) diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb index ba68c517f81..35b3dd219f7 100644 --- a/spec/requests/api/pipelines_spec.rb +++ b/spec/requests/api/pipelines_spec.rb @@ -532,14 +532,8 @@ describe API::Pipelines do expect(json_response['message']).to eq '404 Not found' end - context 'when audit events is enabled' do - before do - stub_licensed_features(extended_audit_events: true, admin_audit_log: true) - end - - it 'does not log an audit event' do - expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.not_to change { SecurityEvent.count } - end + it 'does not log an audit event' do + expect { delete api("/projects/#{project.id}/pipelines/#{pipeline.id}", owner) }.not_to change { SecurityEvent.count } end context 'when the pipeline has jobs' do diff --git a/spec/requests/api/resource_label_events_spec.rb b/spec/requests/api/resource_label_events_spec.rb index 588e9c7050e..37b46eaeb86 100644 --- a/spec/requests/api/resource_label_events_spec.rb +++ b/spec/requests/api/resource_label_events_spec.rb @@ -63,22 +63,6 @@ describe API::ResourceLabelEvents do end end - context 'when eventable is an Epic' do - let(:group) { create(:group, :public) } - let(:epic) { create(:epic, group: group, author: user) } - - before do - group.add_owner(user) - stub_licensed_features(epics: true) - end - - it_behaves_like 'resource_label_events API', 'groups', 'epics', 'id' do - let(:parent) { group } - let(:eventable) { epic } - let!(:event) { create(:resource_label_event, epic: epic) } - end - end - context 'when eventable is a Merge Request' do let(:merge_request) { create(:merge_request, source_project: project, target_project: project, author: user) } diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index e58f1b7d9dc..5c9a5b73ee5 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe 'Git HTTP requests' do include ProjectForksHelper diff --git a/spec/services/ci/destroy_pipeline_service_spec.rb b/spec/services/ci/destroy_pipeline_service_spec.rb index f7adfdc6cfa..bff2b3179fb 100644 --- a/spec/services/ci/destroy_pipeline_service_spec.rb +++ b/spec/services/ci/destroy_pipeline_service_spec.rb @@ -17,6 +17,21 @@ describe ::Ci::DestroyPipelineService do expect { pipeline.reload }.to raise_error(ActiveRecord::RecordNotFound) end + it 'clears the cache', :use_clean_rails_memory_store_caching do + create(:commit_status, :success, pipeline: pipeline, ref: pipeline.ref) + + expect(project.pipeline_status.has_status?).to be_truthy + + subject + + # Need to use find to avoid memoization + expect(Project.find(project.id).pipeline_status.has_status?).to be_falsey + end + + it 'does not log an audit event' do + expect { subject }.not_to change { SecurityEvent.count } + end + context 'when the pipeline has jobs' do let!(:build) { create(:ci_build, project: project, pipeline: pipeline) } diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index 71c4c3ad0d7..95a131e8c86 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -574,7 +574,7 @@ describe QuickActions::InterpretService do context 'Issue' do it 'populates assignee_ids: [] if content contains /unassign' do - issue.update!(assignee_ids: [developer.id]) + issue.update(assignee_ids: [developer.id]) _, updates = service.execute(content, issue) expect(updates).to eq(assignee_ids: []) @@ -583,7 +583,7 @@ describe QuickActions::InterpretService do context 'Merge Request' do it 'populates assignee_ids: [] if content contains /unassign' do - merge_request.update!(assignee_ids: [developer.id]) + merge_request.update(assignee_ids: [developer.id]) _, updates = service.execute(content, merge_request) expect(updates).to eq(assignee_ids: []) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 60fc4224c14..9a320637a2f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -32,8 +32,6 @@ end require 'rainbow/ext/string' Rainbow.enabled = false -require_relative '../ee/spec/spec_helper' - # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. # Requires helpers, and shared contexts/examples first since they're used in other support files diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index 4252db896c7..c69fa322073 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -7,5 +7,3 @@ module DbCleaner DatabaseCleaner[:active_record, { connection: ActiveRecord::Base }] end end - -DbCleaner.prepend(EE::DbCleaner) diff --git a/spec/support/helpers/ldap_helpers.rb b/spec/support/helpers/ldap_helpers.rb index d1505794cc4..66ca5d7f0a3 100644 --- a/spec/support/helpers/ldap_helpers.rb +++ b/spec/support/helpers/ldap_helpers.rb @@ -68,5 +68,3 @@ module LdapHelpers .to receive(:ldap_search).and_raise(Gitlab::Auth::LDAP::LDAPConnectionError) end end - -LdapHelpers.include(EE::LdapHelpers) diff --git a/spec/support/helpers/license_helper.rb b/spec/support/helpers/license_helper.rb index 123415f638b..4aaad55a8ef 100644 --- a/spec/support/helpers/license_helper.rb +++ b/spec/support/helpers/license_helper.rb @@ -6,5 +6,3 @@ module LicenseHelpers # do nothing end end - -LicenseHelpers.prepend(EE::LicenseHelpers) diff --git a/spec/support/helpers/migrations_helpers.rb b/spec/support/helpers/migrations_helpers.rb index 8e13c649cbc..cc1a28cb264 100644 --- a/spec/support/helpers/migrations_helpers.rb +++ b/spec/support/helpers/migrations_helpers.rb @@ -128,5 +128,3 @@ module MigrationsHelpers end end end - -MigrationsHelpers.prepend(EE::MigrationsHelpers) diff --git a/spec/support/helpers/stub_configuration.rb b/spec/support/helpers/stub_configuration.rb index ee4094bc12b..b2fa4c5f3ed 100644 --- a/spec/support/helpers/stub_configuration.rb +++ b/spec/support/helpers/stub_configuration.rb @@ -128,5 +128,3 @@ end require_relative '../../../ee/spec/support/helpers/ee/stub_configuration' if Dir.exist?("#{__dir__}/../../../ee") - -StubConfiguration.prepend(EE::StubConfiguration) diff --git a/spec/support/helpers/stub_gitlab_calls.rb b/spec/support/helpers/stub_gitlab_calls.rb index 9c2e35b0138..4cb3b18df85 100644 --- a/spec/support/helpers/stub_gitlab_calls.rb +++ b/spec/support/helpers/stub_gitlab_calls.rb @@ -133,5 +133,3 @@ module StubGitlabCalls JSON.parse f end end - -StubGitlabCalls.prepend(EE::StubGitlabCalls) diff --git a/spec/support/helpers/stub_object_storage.rb b/spec/support/helpers/stub_object_storage.rb index 222d937678c..d31f9908714 100644 --- a/spec/support/helpers/stub_object_storage.rb +++ b/spec/support/helpers/stub_object_storage.rb @@ -76,5 +76,3 @@ end require_relative '../../../ee/spec/support/helpers/ee/stub_object_storage' if Dir.exist?("#{__dir__}/../../../ee") - -StubObjectStorage.prepend(EE::StubObjectStorage) diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index 4e08dc000b4..77f22d9dd24 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -122,7 +122,7 @@ module TestEnv # Keeps gitlab-shell and gitlab-test def clean_test_path Dir[TMP_TEST_PATH].each do |entry| - unless test_dirs.include?(File.basename(entry)) + unless File.basename(entry) =~ /\A(gitaly|gitlab-(shell|test|test_bare|test-fork|test-fork_bare))\z/ FileUtils.rm_rf(entry) end end @@ -404,8 +404,3 @@ module TestEnv true end end - -require_relative '../../../ee/spec/support/helpers/ee/test_env' - -::TestEnv.prepend(::EE::TestEnv) -::TestEnv.extend(::EE::TestEnv) diff --git a/spec/support/matchers/markdown_matchers.rb b/spec/support/matchers/markdown_matchers.rb index 30a9557db71..ec4ec6f4038 100644 --- a/spec/support/matchers/markdown_matchers.rb +++ b/spec/support/matchers/markdown_matchers.rb @@ -228,5 +228,3 @@ module RSpec::Matchers::DSL::Macros end end end - -MarkdownMatchers.prepend(EE::MarkdownMatchers) diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb index 2befbcb3370..c6c10001bc5 100644 --- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb +++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb @@ -17,7 +17,7 @@ describe 'layouts/nav/sidebar/_project' do it 'has board tab' do render - expect(rendered).to have_css('a[title="Boards"]') + expect(rendered).to have_css('a[title="Board"]') end end diff --git a/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb b/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb index 88c4b52b3a6..0206928a211 100644 --- a/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb +++ b/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb @@ -12,7 +12,6 @@ describe 'projects/merge_requests/creations/_new_submit.html.haml' do assign(:hidden_commit_count, 0) assign(:total_commit_count, merge_request.commits.count) assign(:project, merge_request.target_project) - assign(:target_project, merge_request.target_project) assign(:mr_presenter, merge_request.present(current_user: merge_request.author)) allow(view).to receive(:can?).and_return(true) diff --git a/spec/views/projects/merge_requests/edit.html.haml_spec.rb b/spec/views/projects/merge_requests/edit.html.haml_spec.rb index 0a3a46210ed..529afa03f9c 100644 --- a/spec/views/projects/merge_requests/edit.html.haml_spec.rb +++ b/spec/views/projects/merge_requests/edit.html.haml_spec.rb @@ -23,7 +23,6 @@ describe 'projects/merge_requests/edit.html.haml' do before do assign(:project, project) - assign(:target_project, project) assign(:merge_request, closed_merge_request) assign(:mr_presenter, closed_merge_request.present(current_user: user)) diff --git a/spec/views/shared/_clone_panel.html.haml_spec.rb b/spec/views/shared/_clone_panel.html.haml_spec.rb deleted file mode 100644 index 28f8fb70edb..00000000000 --- a/spec/views/shared/_clone_panel.html.haml_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'shared/_clone_panel' do - include EE::GeoHelpers - - set(:primary) { create(:geo_node, :primary) } - set(:secondary) { create(:geo_node) } - set(:project) { create(:project) } - - shared_examples 'has no geo-specific instructions' do - it 'has no geo-specific instructions' do - render 'shared/clone_panel', project: project - - expect(rendered).not_to match /See Geo-specific instructions/ - end - end - - context 'without Geo enabled' do - it_behaves_like 'has no geo-specific instructions' - end - - context 'On a Geo primary node' do - before do - stub_current_geo_node(primary) - end - - it_behaves_like 'has no geo-specific instructions' - end - - context 'On a Geo secondary node' do - before do - stub_current_geo_node(secondary) - end - - it 'renders Geo-specific instructions button' do - render 'shared/clone_panel', project: project - - expect(rendered).to match /See Geo-specific instructions/ - end - end -end diff --git a/spec/views/shared/_label_row.html.haml.rb b/spec/views/shared/_label_row.html.haml.rb index 9731090b35c..a58d5efc1e3 100644 --- a/spec/views/shared/_label_row.html.haml.rb +++ b/spec/views/shared/_label_row.html.haml.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true require 'spec_helper' describe 'shared/_label_row.html.haml' do |