Skip to content

Commit

Permalink
update feature test coverage for creating pension
Browse files Browse the repository at this point in the history
  • Loading branch information
Harriethw committed Feb 20, 2025
1 parent 894d5b8 commit a70f62c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Create a content object
| amount | string | string | true | | £[0-9]+\\.[0-9]+ |
| cadence | string | string | | a week,a month | |

Scenario: GDS editor creates a Pension
Scenario: GDS editor creates a Pension without a rate
When I visit the Content Block Manager home page
And I click to create an object
Then I should see all the schemas listed
Expand All @@ -27,3 +27,21 @@ Feature: Create a content object
And I review and confirm my answers are correct
Then the edition should have been created successfully
And I should be taken to the confirmation page for a new "pension"

Scenario: GDS editor creates a Pension with a rate
When I visit the Content Block Manager home page
And I click to create an object
Then I should see all the schemas listed
When I click on the "pension" schema
Then I should see a form for the schema
When I complete the form with the following fields:
| title | description | organisation | instructions_to_publishers |
| my basic pension | this is basic | Ministry of Example | this is important |
When I click to create a new "rate"
And I complete the "rate" form with the following fields:
| name | amount | cadence |
| New rate | £127.91 | a month |
Then I should be on the "embedded_rates" step
When I save and continue
And I review and confirm my answers are correct
Then I should be taken to the confirmation page for a new "pension"
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ContentBlockManager::ContentBlockEdition::Details::Fields::EnumComponentTe
ContentBlockManager::ContentBlockEdition::Details::Fields::EnumComponent.new(
content_block_edition:,
field: "something",
enum: %w[a week a month],
enum: ["a week", "a month"],
value: "a week",
),
)
Expand All @@ -41,7 +41,7 @@ class ContentBlockManager::ContentBlockEdition::Details::Fields::EnumComponentTe
assert_selector "select[name=\"#{expected_name}\"][id=\"#{expected_id}\"]"
assert_selector "select[name=\"#{expected_name}\"][id=\"#{expected_id}\"] option[value=\"\"]"
assert_selector "select[name=\"#{expected_name}\"][id=\"#{expected_id}\"] option[value=\"a week\"][selected]", text: "a week"
assert_selector "select[name=\"#{expected_name}\"][id=\"#{expected_id}\"] option[value=\"a month\"]", text: "a month"
assert_selector "select[name=\"#{expected_name}\"][id=\"#{expected_id}\"] option[value=\"a month\"]", text: "a month"
end

it "should show errors when present" do
Expand Down

0 comments on commit a70f62c

Please sign in to comment.