Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
andreslucena committed Dec 13, 2023
1 parent c239f48 commit 24112ba
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions spec/features/proposals_answers_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# frozen_string_literal: true

require "rails_helper"
require "decidim/proposals/test/factories"

describe "Views the proposals answers overrides", type: :system do
let!(:accepted_proposal) { create :proposal, :accepted, component: }
let!(:evaluating_proposal) { create :proposal, :evaluating, component: }

include_context "with a component"
let(:manifest_name) { "proposals" }

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.success")).to match_style("background-color" => "rgba(204, 190, 230, 1)")
expect(page.find("span.label.success")).to match_style("color" => "rgba(102, 57, 186, 1)")
expect(page.find("span.label.warning")).to match_style("background-color" => "rgba(196, 236, 208, 1)")
expect(page.find("span.label.warning")).to match_style("color" => "rgba(22, 89, 46, 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 the catalan 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

context "with the spanish locale" do
before do
within_language_menu do
click_link "Castellano"
end
end

it "views the overrided strings" do
within "main" do
expect(page).to have_content("Finalizada")
expect(page).to have_content("Aceptada / En curso")
end
end
end
end

0 comments on commit 24112ba

Please sign in to comment.