Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 'Fix error message mismatch in election' to v0.26 #11034

Conversation

alecslupu
Copy link
Contributor

🎩 What? Why?

Backport #10946 to v0.26

♥️ Thank you!

@alecslupu alecslupu added backport Pull Requests that are a backport for a fixed bug module: elections type: fix PRs that implement a fix for a bug labels Jun 14, 2023
@alecslupu alecslupu added this to the 0.26.8 milestone Jun 14, 2023
* Fix error message mismatch in election

* Fixing hour pluralization after #10900
@alecslupu alecslupu force-pushed the backport/0.26/fix-error-message-mismatch-in--10946 branch from 8d79401 to bc73cf2 Compare June 14, 2023 20:58
@alecslupu alecslupu added this to Pending review from Product in Maintainers via automation Jun 14, 2023
@alecslupu alecslupu moved this from Pending review from Product to Backport pending in Maintainers Jun 14, 2023
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we're introducing the change in configuration in #10900, as we're changing the specs for this backport.

I'd prefer to leave that change out of this PR as it's a change of the configuration. We would need to change the spec, leaving this particular backport untested. I propose that we introduce a spec for this change, something like this is what I have in mind:

diff --git a/decidim-elections/spec/forms/decidim/elections/admin/setup_form_spec.rb b/decidim-elections/spec/forms/decidim/elections/admin/setup_form_spec.rb
index ece436517e..38fcdbdbe8 100644
--- a/decidim-elections/spec/forms/decidim/elections/admin/setup_form_spec.rb
    b/decidim-elections/spec/forms/decidim/elections/admin/setup_form_spec.rb
@@ -76,6  76,28 @@ describe Decidim::Elections::Admin::SetupForm do
     end
   end
 
   context "when the hours before the start do not comply" do
     before do
       allow(Decidim::Elections).to receive(:setup_minimum_hours_before_start).and_return(hours_before)
     end
 
     context "and there is one hour" do
       let(:hours_before) { 1 }
 
       it "shows the message" do
         expect(subject.messages).to match(hash_including({ time_before: "The setup is being done <strong>at least 1 hour</strong> before the election starts." }))
       end
     end
 
     context "and there are three hours" do
       let(:hours_before) { 3 }
 
       it "shows the message" do
         expect(subject.messages).to match(hash_including({ time_before: "The setup is being done <strong>at least 3 hours</strong> before the election starts." }))
       end
     end
   end
 
   context "when there are no trustees for the election" do
     let(:trustees) { [] }

(Feel free to change it to your taste)

@andreslucena andreslucena merged commit e6c4f4e into release/0.26-stable Jun 15, 2023
12 checks passed
Maintainers automation moved this from Backport pending to Done Jun 15, 2023
@andreslucena andreslucena deleted the backport/0.26/fix-error-message-mismatch-in--10946 branch June 15, 2023 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Pull Requests that are a backport for a fixed bug module: elections type: fix PRs that implement a fix for a bug
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants