Skip to content

Commit

Permalink
Add logo formatted name textarea for editionable worldwide organisations
Browse files Browse the repository at this point in the history
This allows users to add a logo formatted name for the new editionable
worldwide organisations.
  • Loading branch information
jkempster34 committed Jan 2, 2024
1 parent a77c94b commit b56a787
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/views/admin/editionable_worldwide_organisations/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<%= standard_edition_form(edition) do |form| %>
<%= render "govuk_publishing_components/components/textarea", {
label: {
text: "Logo formatted name",
heading_size: "l",
},
name: "edition[logo_formatted_name]",
id: "edition_logo_formatted_name",
value: edition.logo_formatted_name,
error_items: errors_for(edition.errors, :logo_formatted_name),
rows: 4,
} %>
<%= render "govuk_publishing_components/components/fieldset", {
legend_text: "Associations",
heading_level: 2,
Expand Down
2 changes: 2 additions & 0 deletions features/editionable-worldwide-organisations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ Feature: Editionable worldwide organisations
When I draft a new worldwide organisation "Test Worldwide Organisation" assigned to world location "United Kingdom"
Then the worldwide organisation "Test Worldwide Organisation" should have been created
And I should see it has been assigned to the "United Kingdom" world location
And I should see the editionable worldwide organisation "Test Worldwide Organisation" in the list of draft documents

Scenario Outline: Assigning a role to a worldwide organisation
Given a role "Prime Minister" exists
When I draft a new worldwide organisation "Test Worldwide Organisation" assigned to world location "United Kingdom"
And I edit the worldwide organisation "Test Worldwide Organisation" adding the role of "Prime Minister"
Then I should see the "Prime Minister" role has been assigned to the worldwide organisation "Test Worldwide Organisation"

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

Then(/^the worldwide organisation "([^"]*)" should have been created$/) do |title|
@worldwide_organisation = EditionableWorldwideOrganisation.find_by(title:)

expect(@worldwide_organisation).to be_present
expect(@worldwide_organisation.logo_formatted_name).to eq("Logo\r\nformatted\r\nname\r\n")
end

And(/^I should see it has been assigned to the "([^"]*)" world location$/) do |title|
Expand Down
1 change: 1 addition & 0 deletions features/support/document_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def pdf_attachment

def fill_in_worldwide_organisation_fields(world_location: "United Kingdom")
select world_location, from: "World locations"
fill_in "Logo formatted name", with: "Logo\r\nformatted\r\nname\r\n"
end

def fill_in_news_article_fields(first_published: "2010-01-01", announcement_type: "News story")
Expand Down

0 comments on commit b56a787

Please sign in to comment.