From f0c99fb4518ea2d5bbd8a09f263d5425b4eb92a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Pereira=20de=20Lucena?= Date: Wed, 17 Jul 2024 12:40:45 +0200 Subject: [PATCH] Workaround missing require in decidim-dev --- spec/features/proposals_answers_spec.rb | 122 ------------------------ spec/rails_helper.rb | 2 + 2 files changed, 2 insertions(+), 122 deletions(-) delete mode 100644 spec/features/proposals_answers_spec.rb diff --git a/spec/features/proposals_answers_spec.rb b/spec/features/proposals_answers_spec.rb deleted file mode 100644 index 73cf0ff..0000000 --- a/spec/features/proposals_answers_spec.rb +++ /dev/null @@ -1,122 +0,0 @@ -# frozen_string_literal: true - -require "rails_helper" -require "decidim/proposals/test/factories" - -describe "Views the proposals answers overrides", type: :system do - let!(:finished_proposal) { create :proposal, :accepted, component:, title: { en: "This proposal has finished" } } - let!(:progressing_proposal) { create :proposal, :evaluating, component:, title: { en: "This proposal is in progress" } } - - include_context "with a component" - let(:manifest_name) { "proposals" } - - describe "index" do - before do - visit_component - end - - it "views the overrided colors" do - within "main" do - # Capybara understands rgba instead of hexadecimal colors - expect(page.find("span.label.finished")).to match_style("background-color" => "rgba(246, 245, 252, 1)") - expect(page.find("span.label.finished")).to match_style("color" => "rgba(102, 57, 186, 1)") - expect(page.find("span.label.progressing")).to match_style("background-color" => "rgba(196, 236, 208, 1)") - expect(page.find("span.label.progressing")).to match_style("color" => "rgba(22, 89, 34, 1)") - end - end - - context "with the english locale" do - it "views the overrided strings" do - within "main" do - expect(page).to have_content("Finished") - expect(page).to have_content("Accepted / In progress") - end - end - end - - context "with another locale" do - before do - within_language_menu do - click_link "CatalĂ " - end - end - - it "views the overrided strings" do - within "main" do - expect(page).to have_content("Finalitzada") - expect(page).to have_content("Acceptada / En curs") - end - end - end - end - - describe "show" do - before do - visit Decidim::EngineRouter.main_proxy(component).proposal_path(proposal) - end - - context "with the finished proposal" do - let(:proposal) { finished_proposal } - - it "views the overrided colors" do - within "main" do - # Capybara understands rgba instead of hexadecimal colors - expect(page.find("div.flash.finished")).to match_style("background-color" => "rgba(246, 245, 252, 1)") - expect(page.find("div.flash.finished")).to match_style("border-color" => "rgb(102, 57, 186)") - end - end - - it "views the overrided strings" do - within "main div.flash.finished" do - expect(page).to have_content("This proposal has been implemented") - end - end - - context "with another locale" do - before do - within_language_menu do - click_link "Castellano" - end - end - - it "views the overrided strings" do - within "main div.flash.finished" do - expect(page).to have_content("Esta propuesta ha sido implementada") - end - end - end - end - - context "with the progressing proposal" do - let(:proposal) { progressing_proposal } - - it "views the overrided colors" do - within "main" do - # Capybara understands rgba instead of hexadecimal colors - expect(page.find("div.flash.progressing")).to match_style("background-color" => "rgba(246, 253, 249, 1)") - expect(page.find("div.flash.progressing")).to match_style("border-color" => "rgb(22, 89, 34)") - end - end - - it "views the overrided strings" do - within "main div.flash.progressing" do - expect(page).to have_content("This proposal has been accepted") - end - end - - context "with another locale" do - before do - within_language_menu do - click_link "CatalĂ " - end - end - - it "views the overrided strings" do - within "main div.flash.progressing" do - expect(page).to have_content("Aquesta proposta ha sigut acceptada") - end - end - end - end - end -end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 03d79f8..0d4c2af 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -10,6 +10,8 @@ Decidim::Dev.dummy_app_path = File.expand_path(File.join(__dir__, "..")) +require "parallel_tests" + require "decidim/dev/test/base_spec_helper" # Add additional requires below this line. Rails is not loaded until this point!