Skip to content

Commit

Permalink
Added not_debated to drop down list
Browse files Browse the repository at this point in the history
  • Loading branch information
thatkevin committed Feb 8, 2024
1 parent 06ddeb6 commit a0d1908
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion config/locales/petitions.en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ en-GB:
- :with_response
- :awaiting_debate
- :debated
- :not_debated
admin_archived:
- :all
- :published
Expand All @@ -110,6 +111,7 @@ en-GB:
- :with_response
- :awaiting_debate
- :debated
- :not_debated
names:
admin:
all: "All petitions (%{quantity})"
Expand All @@ -131,6 +133,7 @@ en-GB:
with_response: "With a government response (%{quantity})"
awaiting_debate: "Awaiting a debate in parliament (%{quantity})"
debated: "Has been debated in parliament (%{quantity})"
not_debated: "Has not been debated in parliament (%{quantity})"
admin_archived:
all: "All petitions (%{quantity})"
published: "Published (%{quantity})"
Expand All @@ -141,7 +144,7 @@ en-GB:
with_response: "With a government response (%{quantity})"
awaiting_debate: "Awaiting a debate in parliament (%{quantity})"
debated: "Has been debated in parliament (%{quantity})"

not_debated: "Has not been debated in parliament (%{quantity})"
emails:
subjects:
# Emails to people who sign petitions
Expand Down
8 changes: 6 additions & 2 deletions spec/helpers/admin_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
overdue_in_moderation: 8, tagged_in_moderation: 9, untagged_in_moderation: 10,
open: 11, closed: 12, rejected: 13, hidden: 14, stopped: 15,
awaiting_response: 16, with_response: 17, awaiting_debate: 18,
debated: 19
debated: 19, not_debated: 20
}
end

subject { helper.admin_petition_facets_for_select(facets, selected) }

it "generates the correct number of options" do
expect(subject).to have_css("option", count: 19)
expect(subject).to have_css("option", count: 20)
end

it "generates the correct option for 'all'" do
Expand Down Expand Up @@ -97,6 +97,10 @@
expect(subject).to have_css("option:nth-of-type(19)[value='debated']", text: "Has been debated in parliament (19)")
end

it "generates the correct option for 'not_debated'" do
expect(subject).to have_css("option:nth-of-type(20)[value='not_debated']", text: "Has not been debated in parliament (20)")
end

it "marks the correct option as selected" do
expect(subject).to have_css("option[value='open'][selected]")
end
Expand Down

0 comments on commit a0d1908

Please sign in to comment.