-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ def when_i_visit_the_download_link_in_the_email | |
end | ||
|
||
def then_i_see_the_error_page | ||
expect(page).to have_title("Sorry, there is a problem with the download link - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Sorry, there is a problem with the download link") | ||
expect(page).to have_element(:p, text: "You are seeing this page because the download link is not working. It may have timed out or contained an invalid security token.", class: "govuk-body") | ||
expect(page).to have_element(:p, text: "Email [email protected] to request a new download link.", class: "govuk-body") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ def when_i_visit_the_download_link_in_the_email | |
end | ||
|
||
def then_i_see_the_error_page | ||
expect(page).to have_title("Sorry, there is a problem with the download link - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Sorry, there is a problem with the download link") | ||
expect(page).to have_element(:p, text: "You are seeing this page because the download link is not working. It may have timed out or contained an invalid security token.", class: "govuk-body") | ||
expect(page).to have_element(:p, text: "Email [email protected] to request a new download link.", class: "govuk-body") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ def when_i_visit_the_download_link_in_the_email | |
end | ||
|
||
def then_i_see_the_error_page | ||
expect(page).to have_title("Sorry, there is a problem with the download link - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Sorry, there is a problem with the download link") | ||
expect(page).to have_element(:p, text: "You are seeing this page because the download link is not working. It may have timed out or contained an invalid security token.", class: "govuk-body") | ||
expect(page).to have_element(:p, text: "Email [email protected] to request a new download link.", class: "govuk-body") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ def when_i_visit_the_download_link_in_the_email | |
end | ||
|
||
def then_i_see_the_download_page | ||
expect(page).to have_title("Download the sampling CSV - Claim funding for mentor training - GOV.UK") | ||
expect(page).to have_h1("Download the sampling CSV") | ||
expect(page).to have_element(:p, text: "Download the Claim funding for mentor training sampling CSV file.", class: "govuk-body") | ||
expect(page).to have_element(:p, text: "If you have any questions, email [email protected]", class: "govuk-body") | ||
|
@@ -39,7 +40,8 @@ def when_i_click_on_the_download_button | |
|
||
def then_the_csv_is_downloaded | ||
current_time = Time.zone.now.utc.strftime("%Y-%m-%dT%H%%3A%M%%3A%SZ") | ||
provider_name = @provider_sampling.provider_name.parameterize | ||
expect(page.response_headers["Content-Type"]).to eq("text/csv") | ||
expect(page.response_headers["Content-Disposition"]).to eq("attachment; filename=\"sampling-claims-#{current_time}.csv\"; filename*=UTF-8''sampling-claims-#{current_time}.csv") | ||
expect(page.response_headers["Content-Disposition"]).to eq("attachment; filename=\"sampling-claims-#{provider_name}-#{current_time}.csv\"; filename*=UTF-8''sampling-claims-#{provider_name}-#{current_time}.csv") | ||
end | ||
end |