diff --git a/Gemfile b/Gemfile index b07610b..86352e5 100644 --- a/Gemfile +++ b/Gemfile @@ -35,7 +35,13 @@ group :development, :test do # gem "net-pop", "~> 0.1.1" # gem "net-smtp", "~> 0.3.1" gem "parallel_tests", "~> 4.2" + + # rubocop & rubocop-rspec are set to the following versions because of a change where FactoryBot/CreateList + # must be a boolean instead of contextual. These version locks can be removed when this problem is handled + # through decidim-dev. + gem "rubocop", "~>1.28" gem "rubocop-faker" + gem "rubocop-rspec", "2.20" end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index d1d524f..7f54a3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -709,9 +709,7 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) + rubocop-capybara (2.21.0) rubocop (~> 1.41) rubocop-faker (1.1.0) faker (>= 2.12.0) @@ -721,13 +719,9 @@ GEM rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (2.29.2) - rubocop (~> 1.40) + rubocop-rspec (2.20.0) + rubocop (~> 1.33) rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - rubocop-rspec_rails (~> 2.28) - rubocop-rspec_rails (2.28.3) - rubocop (~> 1.40) ruby-progressbar (1.13.0) ruby-vips (2.2.1) ffi (~> 1.12) @@ -857,7 +851,9 @@ DEPENDENCIES listen (~> 3.8) parallel_tests (~> 4.2) puma (>= 6.4.2) + rubocop (~> 1.28) rubocop-faker + rubocop-rspec (= 2.20) spring (~> 4.1.3) spring-watcher-listen (~> 2.1) web-console (~> 4.2) diff --git a/spec/system/private_process_spec.rb b/spec/system/private_process_spec.rb deleted file mode 100644 index 916cc5f..0000000 --- a/spec/system/private_process_spec.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require "spec_helper" - -describe "Private Participatory Processes", type: :system do - let!(:organization) { create(:organization) } - let!(:participatory_process) { create :participatory_process, :published, organization: organization } - let!(:private_participatory_process) { create :participatory_process, :published, organization: organization, private_space: true } - let!(:private_user) { create :user, :confirmed, organization: organization } - let!(:participatory_space_private_user) { create :participatory_space_private_user, user: private_user, privatable_to: private_participatory_process } - - context "when user is logged in and is a \"private participatory process\" -user and also a private user" do - before do - switch_to_host(organization.host) - login_as private_user, scope: :user - visit decidim_participatory_processes.participatory_processes_path - end - - it "lists private participatory processes" do - within "#processes-grid" do - within "#processes-grid h3" do - expect(page).to have_content("2") - end - - expect(page).to have_content(translated(participatory_process.title, locale: :en)) - expect(page).to have_content(translated(private_participatory_process.title, locale: :en)) - expect(page).to have_selector(".card", count: 2) - end - end - - it "links to the individual process page" do - first(".card__link", text: translated(private_participatory_process.title, locale: :en)).click - - expect(page).to have_current_path decidim_participatory_processes.participatory_process_path(private_participatory_process) - expect(page).to have_content "This is a private process" - end - end - - context "when listing private participatory process private users and user is a private user" do - let!(:admin) { create :user, :admin, :confirmed, organization: organization } - - before do - switch_to_host(organization.host) - login_as admin, scope: :user - visit decidim_admin_participatory_processes.edit_participatory_process_path(private_participatory_process) - find("a[href*='participatory_space_private_users']").click - end - - it "shows user in the list" do - expect(page).to have_content(private_user.name) - expect(page).to have_content(private_user.email) - end - end -end