diff options
Diffstat (limited to 'spec/views/projects')
40 files changed, 60 insertions, 163 deletions
diff --git a/spec/views/projects/_home_panel.html.haml_spec.rb b/spec/views/projects/_home_panel.html.haml_spec.rb index 9956144b601..548dba7874a 100644 --- a/spec/views/projects/_home_panel.html.haml_spec.rb +++ b/spec/views/projects/_home_panel.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/_home_panel' do +RSpec.describe 'projects/_home_panel' do include ProjectForksHelper context 'notifications' do diff --git a/spec/views/projects/blob/_viewer.html.haml_spec.rb b/spec/views/projects/blob/_viewer.html.haml_spec.rb index a798a72fa76..893cfec1491 100644 --- a/spec/views/projects/blob/_viewer.html.haml_spec.rb +++ b/spec/views/projects/blob/_viewer.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/blob/_viewer.html.haml' do +RSpec.describe 'projects/blob/_viewer.html.haml' do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/views/projects/buttons/_dropdown.html.haml_spec.rb b/spec/views/projects/buttons/_dropdown.html.haml_spec.rb index 2bc1de040d5..fc9d7c3ea91 100644 --- a/spec/views/projects/buttons/_dropdown.html.haml_spec.rb +++ b/spec/views/projects/buttons/_dropdown.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/buttons/_dropdown' do +RSpec.describe 'projects/buttons/_dropdown' do let(:user) { create(:user) } context 'user with all abilities' do diff --git a/spec/views/projects/ci/lints/show.html.haml_spec.rb b/spec/views/projects/ci/lints/show.html.haml_spec.rb index 8c3cf04bae6..bcfb952ca66 100644 --- a/spec/views/projects/ci/lints/show.html.haml_spec.rb +++ b/spec/views/projects/ci/lints/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/ci/lints/show' do +RSpec.describe 'projects/ci/lints/show' do include Devise::Test::ControllerHelpers let(:project) { create(:project, :repository) } let(:config_processor) { Gitlab::Ci::YamlProcessor.new(YAML.dump(content)) } diff --git a/spec/views/projects/clusters/clusters/gcp/_form.html.haml_spec.rb b/spec/views/projects/clusters/clusters/gcp/_form.html.haml_spec.rb index 1cb2f9a4301..bf5cb6fb25d 100644 --- a/spec/views/projects/clusters/clusters/gcp/_form.html.haml_spec.rb +++ b/spec/views/projects/clusters/clusters/gcp/_form.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'clusters/clusters/gcp/_form' do +RSpec.describe 'clusters/clusters/gcp/_form' do let(:admin) { create(:admin) } let(:environment) { create(:environment) } let(:gcp_cluster) { create(:cluster, :provided_by_gcp) } diff --git a/spec/views/projects/commit/_commit_box.html.haml_spec.rb b/spec/views/projects/commit/_commit_box.html.haml_spec.rb index 07c530670d2..9c97696493e 100644 --- a/spec/views/projects/commit/_commit_box.html.haml_spec.rb +++ b/spec/views/projects/commit/_commit_box.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/commit/_commit_box.html.haml' do +RSpec.describe 'projects/commit/_commit_box.html.haml' do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/views/projects/commit/branches.html.haml_spec.rb b/spec/views/projects/commit/branches.html.haml_spec.rb index 0fe7165a790..f1064be3047 100644 --- a/spec/views/projects/commit/branches.html.haml_spec.rb +++ b/spec/views/projects/commit/branches.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/commit/branches.html.haml' do +RSpec.describe 'projects/commit/branches.html.haml' do let(:project) { create(:project, :repository) } before do diff --git a/spec/views/projects/commit/show.html.haml_spec.rb b/spec/views/projects/commit/show.html.haml_spec.rb index af28a8f9193..c2970abbe9f 100644 --- a/spec/views/projects/commit/show.html.haml_spec.rb +++ b/spec/views/projects/commit/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/commit/show.html.haml' do +RSpec.describe 'projects/commit/show.html.haml' do let(:project) { create(:project, :repository) } let(:commit) { project.commit } diff --git a/spec/views/projects/commits/_commit.html.haml_spec.rb b/spec/views/projects/commits/_commit.html.haml_spec.rb index 1c01a7f9a9c..898d3baae19 100644 --- a/spec/views/projects/commits/_commit.html.haml_spec.rb +++ b/spec/views/projects/commits/_commit.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/commits/_commit.html.haml' do +RSpec.describe 'projects/commits/_commit.html.haml' do let(:template) { 'projects/commits/commit.html.haml' } let(:project) { create(:project, :repository) } let(:commit) { project.repository.commit(ref) } diff --git a/spec/views/projects/deployments/_confirm_rollback_modal_spec.html_spec.rb b/spec/views/projects/deployments/_confirm_rollback_modal_spec.html_spec.rb index 9168bc8e833..2fb7b6187eb 100644 --- a/spec/views/projects/deployments/_confirm_rollback_modal_spec.html_spec.rb +++ b/spec/views/projects/deployments/_confirm_rollback_modal_spec.html_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/deployments/_confirm_rollback_modal' do +RSpec.describe 'projects/deployments/_confirm_rollback_modal' do let(:environment) { create(:environment, :with_review_app) } let(:deployments) { environment.deployments } let(:project) { environment.project } diff --git a/spec/views/projects/diffs/_stats.html.haml_spec.rb b/spec/views/projects/diffs/_stats.html.haml_spec.rb index eb853596f98..f0580b50349 100644 --- a/spec/views/projects/diffs/_stats.html.haml_spec.rb +++ b/spec/views/projects/diffs/_stats.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/diffs/_stats.html.haml' do +RSpec.describe 'projects/diffs/_stats.html.haml' do let(:project) { create(:project, :repository) } let(:commit) { project.commit('570e7b2abdd848b95f2f578043fc23bd6f6fd24d') } diff --git a/spec/views/projects/diffs/_viewer.html.haml_spec.rb b/spec/views/projects/diffs/_viewer.html.haml_spec.rb index 27f271bb178..305c44190b4 100644 --- a/spec/views/projects/diffs/_viewer.html.haml_spec.rb +++ b/spec/views/projects/diffs/_viewer.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/diffs/_viewer.html.haml' do +RSpec.describe 'projects/diffs/_viewer.html.haml' do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/views/projects/edit.html.haml_spec.rb b/spec/views/projects/edit.html.haml_spec.rb index 0c0f74a41f0..b44d07d2ee4 100644 --- a/spec/views/projects/edit.html.haml_spec.rb +++ b/spec/views/projects/edit.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/edit' do +RSpec.describe 'projects/edit' do include Devise::Test::ControllerHelpers include ProjectForksHelper diff --git a/spec/views/projects/environments/terminal.html.haml_spec.rb b/spec/views/projects/environments/terminal.html.haml_spec.rb index b0b08a84f8d..bfb88f0f72b 100644 --- a/spec/views/projects/environments/terminal.html.haml_spec.rb +++ b/spec/views/projects/environments/terminal.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/environments/terminal' do +RSpec.describe 'projects/environments/terminal' do let!(:environment) { create(:environment, :with_review_app) } before do diff --git a/spec/views/projects/imports/new.html.haml_spec.rb b/spec/views/projects/imports/new.html.haml_spec.rb index 6cca369b9f6..edf9eadf924 100644 --- a/spec/views/projects/imports/new.html.haml_spec.rb +++ b/spec/views/projects/imports/new.html.haml_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "projects/imports/new.html.haml" do +RSpec.describe "projects/imports/new.html.haml" do let(:user) { create(:user) } context 'when import fails' do diff --git a/spec/views/projects/issues/_related_branches.html.haml_spec.rb b/spec/views/projects/issues/_related_branches.html.haml_spec.rb index 6c9bbaea38c..ba6f7068024 100644 --- a/spec/views/projects/issues/_related_branches.html.haml_spec.rb +++ b/spec/views/projects/issues/_related_branches.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/issues/_related_branches' do +RSpec.describe 'projects/issues/_related_branches' do include Devise::Test::ControllerHelpers let(:pipeline) { build(:ci_pipeline, :success) } diff --git a/spec/views/projects/issues/import_csv/_button.html.haml_spec.rb b/spec/views/projects/issues/import_csv/_button.html.haml_spec.rb index 440edd376e0..8bc0a00d71c 100644 --- a/spec/views/projects/issues/import_csv/_button.html.haml_spec.rb +++ b/spec/views/projects/issues/import_csv/_button.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/issues/import_csv/_button' do +RSpec.describe 'projects/issues/import_csv/_button' do include Devise::Test::ControllerHelpers context 'when the user does not have edit permissions' do diff --git a/spec/views/projects/issues/show.html.haml_spec.rb b/spec/views/projects/issues/show.html.haml_spec.rb index 60a541916e9..b2d208f038a 100644 --- a/spec/views/projects/issues/show.html.haml_spec.rb +++ b/spec/views/projects/issues/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/issues/show' do +RSpec.describe 'projects/issues/show' do include_context 'project show action' context 'when the issue is closed' do @@ -23,7 +23,7 @@ describe 'projects/issues/show' do project.add_developer(user) end - it 'shows "Closed (moved)" if an issue has been moved' do + it 'shows "Closed (moved)" if an issue has been moved and closed' do render expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)') @@ -41,6 +41,14 @@ describe 'projects/issues/show' do expect(rendered).to have_selector("a[href=\"#{issue_path(new_issue)}\"]", text: 'moved') end + + it 'does not show "closed (moved)" if an issue has been moved and reopened (not closed)' do + allow(issue).to receive(:closed?).and_return(false) + + render + + expect(rendered).not_to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)') + end end context 'when user cannot see moved issue' do diff --git a/spec/views/projects/jobs/_build.html.haml_spec.rb b/spec/views/projects/jobs/_build.html.haml_spec.rb index 681df77ea99..4256df9ce9a 100644 --- a/spec/views/projects/jobs/_build.html.haml_spec.rb +++ b/spec/views/projects/jobs/_build.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/ci/jobs/_build' do +RSpec.describe 'projects/ci/jobs/_build' do include Devise::Test::ControllerHelpers let(:project) { create(:project, :repository) } diff --git a/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb b/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb index f193ce0a552..9be2a6f0ce4 100644 --- a/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb +++ b/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/generic_commit_statuses/_generic_commit_status.html.haml' do +RSpec.describe 'projects/generic_commit_statuses/_generic_commit_status.html.haml' do include Devise::Test::ControllerHelpers let(:project) { create(:project, :repository) } diff --git a/spec/views/projects/jobs/show.html.haml_spec.rb b/spec/views/projects/jobs/show.html.haml_spec.rb index 903a16d9e53..83a00135629 100644 --- a/spec/views/projects/jobs/show.html.haml_spec.rb +++ b/spec/views/projects/jobs/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/jobs/show' do +RSpec.describe 'projects/jobs/show' do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:build) { create(:ci_build, pipeline: pipeline) } diff --git a/spec/views/projects/merge_requests/_commits.html.haml_spec.rb b/spec/views/projects/merge_requests/_commits.html.haml_spec.rb index 755a40a7e4c..fd77c4eb372 100644 --- a/spec/views/projects/merge_requests/_commits.html.haml_spec.rb +++ b/spec/views/projects/merge_requests/_commits.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/merge_requests/_commits.html.haml', :sidekiq_might_not_need_inline do +RSpec.describe 'projects/merge_requests/_commits.html.haml', :sidekiq_might_not_need_inline do include Devise::Test::ControllerHelpers include ProjectForksHelper 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 f7db4a4d614..038a94fe7c3 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 @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/merge_requests/creations/_new_submit.html.haml' do +RSpec.describe 'projects/merge_requests/creations/_new_submit.html.haml' do let(:merge_request) { create(:merge_request) } let!(:pipeline) { create(:ci_empty_pipeline) } diff --git a/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb b/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb index a82ef3c04b5..7cdc817d784 100644 --- a/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb +++ b/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/merge_requests/diffs/_diffs.html.haml' do +RSpec.describe 'projects/merge_requests/diffs/_diffs.html.haml' do include Devise::Test::ControllerHelpers let(:user) { create(:user) } 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 74d9067076c..55a74dc8229 100644 --- a/spec/views/projects/merge_requests/edit.html.haml_spec.rb +++ b/spec/views/projects/merge_requests/edit.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/merge_requests/edit.html.haml' do +RSpec.describe 'projects/merge_requests/edit.html.haml' do include Devise::Test::ControllerHelpers include ProjectForksHelper diff --git a/spec/views/projects/merge_requests/show.html.haml_spec.rb b/spec/views/projects/merge_requests/show.html.haml_spec.rb index e0acf5d1507..32819fc2cb0 100644 --- a/spec/views/projects/merge_requests/show.html.haml_spec.rb +++ b/spec/views/projects/merge_requests/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/merge_requests/show.html.haml' do +RSpec.describe 'projects/merge_requests/show.html.haml' do before do allow(view).to receive(:experiment_enabled?).and_return(false) end diff --git a/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb b/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb index a07523a4423..3776af9e757 100644 --- a/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb +++ b/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/notes/_more_actions_dropdown' do +RSpec.describe 'projects/notes/_more_actions_dropdown' do let(:author_user) { create(:user) } let(:not_author_user) { create(:user) } diff --git a/spec/views/projects/pages/show.html.haml_spec.rb b/spec/views/projects/pages/show.html.haml_spec.rb index 63b66616f31..fac46d08f0c 100644 --- a/spec/views/projects/pages/show.html.haml_spec.rb +++ b/spec/views/projects/pages/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/pages/show' do +RSpec.describe 'projects/pages/show' do include LetsEncryptHelpers let(:project) { create(:project, :repository) } diff --git a/spec/views/projects/pages_domains/show.html.haml_spec.rb b/spec/views/projects/pages_domains/show.html.haml_spec.rb index 2de82a63560..d2abe3dfa56 100644 --- a/spec/views/projects/pages_domains/show.html.haml_spec.rb +++ b/spec/views/projects/pages_domains/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/pages_domains/show' do +RSpec.describe 'projects/pages_domains/show' do let(:project) { create(:project, :repository) } before do diff --git a/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb b/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb index daf799ec13f..e650e183bc8 100644 --- a/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb +++ b/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/pipeline_schedules/_pipeline_schedule' do +RSpec.describe 'projects/pipeline_schedules/_pipeline_schedule' do let(:owner) { create(:user) } let(:maintainer) { create(:user) } let(:project) { create(:project) } diff --git a/spec/views/projects/pipelines/_stage.html.haml_spec.rb b/spec/views/projects/pipelines/_stage.html.haml_spec.rb index 591602859c3..c8f6784a0f6 100644 --- a/spec/views/projects/pipelines/_stage.html.haml_spec.rb +++ b/spec/views/projects/pipelines/_stage.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/pipelines/_stage' do +RSpec.describe 'projects/pipelines/_stage' do let(:project) { create(:project, :repository) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:stage) { build(:ci_stage, pipeline: pipeline) } @@ -54,7 +54,7 @@ describe 'projects/pipelines/_stage' do context 'when there are multiple builds' do before do - HasStatus::AVAILABLE_STATUSES.each do |status| + Ci::HasStatus::AVAILABLE_STATUSES.each do |status| create_build(status) end end @@ -62,7 +62,7 @@ describe 'projects/pipelines/_stage' do it 'shows them in order' do render - expect(rendered).to have_text(HasStatus::ORDERED_STATUSES.join(" ")) + expect(rendered).to have_text(Ci::HasStatus::ORDERED_STATUSES.join(" ")) end def create_build(status) diff --git a/spec/views/projects/services/_form.haml_spec.rb b/spec/views/projects/services/_form.haml_spec.rb index 720e0aaf450..f5c4e79a082 100644 --- a/spec/views/projects/services/_form.haml_spec.rb +++ b/spec/views/projects/services/_form.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/services/_form' do +RSpec.describe 'projects/services/_form' do let(:project) { create(:redmine_project) } let(:user) { create(:admin) } diff --git a/spec/views/projects/services/edit.html.haml_spec.rb b/spec/views/projects/services/edit.html.haml_spec.rb index 12e1cda2c00..785af6a5344 100644 --- a/spec/views/projects/services/edit.html.haml_spec.rb +++ b/spec/views/projects/services/edit.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/services/edit' do +RSpec.describe 'projects/services/edit' do let(:service) { create(:drone_ci_service, project: project) } let(:project) { create(:project) } diff --git a/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb index d25860ab301..b3f59a59ac8 100644 --- a/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb +++ b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/settings/ci_cd/_autodevops_form' do +RSpec.describe 'projects/settings/ci_cd/_autodevops_form' do let(:project) { create(:project, :repository) } before do diff --git a/spec/views/projects/settings/operations/show.html.haml_spec.rb b/spec/views/projects/settings/operations/show.html.haml_spec.rb index 7d6faae0f5a..1f0b0ea76bf 100644 --- a/spec/views/projects/settings/operations/show.html.haml_spec.rb +++ b/spec/views/projects/settings/operations/show.html.haml_spec.rb @@ -2,9 +2,16 @@ require 'spec_helper' -describe 'projects/settings/operations/show' do - let(:project) { create(:project) } - let(:user) { create(:user) } +RSpec.describe 'projects/settings/operations/show' do + let_it_be(:project) { create(:project) } + let_it_be(:user) { create(:user) } + + let(:operations_show_locals) do + { + prometheus_service: project.find_or_initialize_service('prometheus'), + alerts_service: project.find_or_initialize_service('alerts') + } + end before do assign :project, project @@ -20,13 +27,13 @@ describe 'projects/settings/operations/show' do allow(view).to receive(:incident_management_available?) { false } end - let!(:error_tracking_setting) do + let_it_be(:error_tracking_setting) do create(:project_error_tracking_setting, project: project) end context 'Settings page ' do it 'renders the Operations Settings page' do - render template: "projects/settings/operations/show", locals: { prometheus_service: project.find_or_initialize_service('prometheus') } + render template: 'projects/settings/operations/show', locals: operations_show_locals expect(rendered).to have_content _('Error Tracking') expect(rendered).to have_content _('To link Sentry to GitLab, enter your Sentry URL and Auth Token') diff --git a/spec/views/projects/show.html.haml_spec.rb b/spec/views/projects/show.html.haml_spec.rb deleted file mode 100644 index c28260f422c..00000000000 --- a/spec/views/projects/show.html.haml_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'projects/show.html.haml' do - include Devise::Test::ControllerHelpers - - let(:user) { create(:admin) } - let(:project) { create(:project, :repository) } - - before do - presented_project = project.present(current_user: user) - - allow(presented_project).to receive(:default_view).and_return('customize_workflow') - allow(controller).to receive(:current_user).and_return(user) - - assign(:project, presented_project) - end - - context 'commit signatures' do - context 'with vue tree view enabled' do - it 'are not rendered via js-signature-container' do - render - - expect(rendered).not_to have_css('.js-signature-container') - end - end - - context 'with vue tree view disabled' do - before do - stub_feature_flags(vue_file_list: false) - end - - it 'rendered via js-signature-container' do - render - - expect(rendered).to have_css('.js-signature-container') - end - end - end -end diff --git a/spec/views/projects/tags/index.html.haml_spec.rb b/spec/views/projects/tags/index.html.haml_spec.rb index 08fbada9c9c..4d501b82238 100644 --- a/spec/views/projects/tags/index.html.haml_spec.rb +++ b/spec/views/projects/tags/index.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/tags/index.html.haml' do +RSpec.describe 'projects/tags/index.html.haml' do let(:project) { create(:project, :repository) } let(:tags) { TagsFinder.new(project.repository, {}).execute } let(:git_tag) { project.repository.tags.last } diff --git a/spec/views/projects/tree/_tree_header.html.haml_spec.rb b/spec/views/projects/tree/_tree_header.html.haml_spec.rb deleted file mode 100644 index 69ad331f880..00000000000 --- a/spec/views/projects/tree/_tree_header.html.haml_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe 'projects/tree/_tree_header' do - let(:project) { create(:project, :repository) } - let(:current_user) { create(:user) } - let(:repository) { project.repository } - - before do - stub_feature_flags(vue_file_list: false) - - assign(:project, project) - assign(:repository, repository) - assign(:id, File.join('master', '')) - assign(:ref, 'master') - - allow(view).to receive(:current_user).and_return(current_user) - allow(view).to receive(:can_collaborate_with_project?) { true } - end - - it 'renders the WebIDE button when user can collaborate but not create fork or MR' do - allow(view).to receive(:can?) { false } - - render - - expect(rendered).to have_link('Web IDE') - end - - it 'renders the WebIDE button when user can create fork and can open MR in project' do - allow(view).to receive(:can?) { true } - - render - - expect(rendered).to have_link('Web IDE') - end - - it 'opens a popup confirming a fork if the user can create fork/MR but cannot collaborate with the project' do - allow(view).to receive(:can?) { true } - allow(view).to receive(:can_collaborate_with_project?) { false } - - render - - expect(rendered).to have_link('Web IDE', href: '#modal-confirm-fork') - end - - it 'does not render the WebIDE button when user cannot collaborate or create mr' do - allow(view).to receive(:can?) { false } - allow(view).to receive(:can_collaborate_with_project?) { false } - - render - - expect(rendered).not_to have_link('Web IDE') - end -end diff --git a/spec/views/projects/tree/_tree_row.html.haml_spec.rb b/spec/views/projects/tree/_tree_row.html.haml_spec.rb index 864272fc146..43a37934afd 100644 --- a/spec/views/projects/tree/_tree_row.html.haml_spec.rb +++ b/spec/views/projects/tree/_tree_row.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/tree/_tree_row' do +RSpec.describe 'projects/tree/_tree_row' do let(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/views/projects/tree/show.html.haml_spec.rb b/spec/views/projects/tree/show.html.haml_spec.rb index 8c6b229247d..bdf9b08d8f5 100644 --- a/spec/views/projects/tree/show.html.haml_spec.rb +++ b/spec/views/projects/tree/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'projects/tree/show' do +RSpec.describe 'projects/tree/show' do include Devise::Test::ControllerHelpers let(:project) { create(:project, :repository) } @@ -39,26 +39,4 @@ describe 'projects/tree/show' do expect(rendered).to have_css('.js-project-refs-dropdown .dropdown-toggle-text', text: ref) end end - - context 'commit signatures' do - context 'with vue tree view disabled' do - before do - stub_feature_flags(vue_file_list: false) - end - - it 'rendered via js-signature-container' do - render - - expect(rendered).to have_css('.js-signature-container') - end - end - - context 'with vue tree view enabled' do - it 'are not rendered via js-signature-container' do - render - - expect(rendered).not_to have_css('.js-signature-container') - end - end - end end |