diff --git a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_expired_token_spec.rb b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_expired_token_spec.rb
index d8e3fa2a7..d01dc3a17 100644
--- a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_expired_token_spec.rb
+++ b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_expired_token_spec.rb
@@ -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 ittmentor.funding@education.gov.uk to request a new download link.", class: "govuk-body")
diff --git a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_record_token_spec.rb b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_record_token_spec.rb
index ae9b32dda..4c1e4b813 100644
--- a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_record_token_spec.rb
+++ b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_record_token_spec.rb
@@ -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 ittmentor.funding@education.gov.uk to request a new download link.", class: "govuk-body")
diff --git a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_token_spec.rb b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_token_spec.rb
index 38a34cd1e..ed20edfd9 100644
--- a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_token_spec.rb
+++ b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_invalid_token_spec.rb
@@ -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 ittmentor.funding@education.gov.uk to request a new download link.", class: "govuk-body")
diff --git a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_valid_token_spec.rb b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_valid_token_spec.rb
index 6fcc8cc1e..1c09f7398 100644
--- a/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_valid_token_spec.rb
+++ b/spec/system/claims/sampling/claims/provider_user_downloads_sampling_csv_with_valid_token_spec.rb
@@ -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 ittmentor.funding@education.gov.uk", 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