Browse Source

feat: update tests

CLDC-3196-update-bu-resources-link
natdeanlewissoftwire 11 months ago
parent
commit
00b96cb413
  1. 6
      spec/requests/bulk_upload_lettings_logs_controller_spec.rb
  2. 6
      spec/requests/bulk_upload_sales_logs_controller_spec.rb

6
spec/requests/bulk_upload_lettings_logs_controller_spec.rb

@ -49,7 +49,7 @@ RSpec.describe BulkUploadLettingsLogsController, type: :request do
it "shows guidance page with correct title" do it "shows guidance page with correct title" do
Timecop.freeze(2022, 1, 1) do Timecop.freeze(2022, 1, 1) do
get "/lettings-logs/bulk-upload-logs/guidance", params: {} get "/lettings-logs/bulk-upload-logs/guidance?form%5Byear%5D=#{expected_year}", params: {}
expect(response.body).to include("How to upload logs in bulk") expect(response.body).to include("How to upload logs in bulk")
end end
@ -57,9 +57,11 @@ RSpec.describe BulkUploadLettingsLogsController, type: :request do
end end
context "when in crossover period" do context "when in crossover period" do
let(:expected_year) { FormHandler.instance.forms["current_sales"].start_date.year }
it "shows guidance page with correct title" do it "shows guidance page with correct title" do
Timecop.freeze(2023, 6, 1) do Timecop.freeze(2023, 6, 1) do
get "/lettings-logs/bulk-upload-logs/guidance", params: {} get "/lettings-logs/bulk-upload-logs/guidance?form%5Byear%5D=#{expected_year}", params: {}
expect(response.body).to include("How to upload logs in bulk") expect(response.body).to include("How to upload logs in bulk")
end end

6
spec/requests/bulk_upload_sales_logs_controller_spec.rb

@ -49,7 +49,7 @@ RSpec.describe BulkUploadSalesLogsController, type: :request do
it "shows guidance page with correct title" do it "shows guidance page with correct title" do
Timecop.freeze(2022, 1, 1) do Timecop.freeze(2022, 1, 1) do
get "/sales-logs/bulk-upload-logs/guidance", params: {} get "/sales-logs/bulk-upload-logs/guidance?form%5Byear%5D=#{expected_year}", params: {}
expect(response.body).to include("How to upload logs in bulk") expect(response.body).to include("How to upload logs in bulk")
end end
@ -57,9 +57,11 @@ RSpec.describe BulkUploadSalesLogsController, type: :request do
end end
context "when in crossover period" do context "when in crossover period" do
let(:expected_year) { FormHandler.instance.forms["current_sales"].start_date.year }
it "shows guidance page with correct title" do it "shows guidance page with correct title" do
Timecop.freeze(2023, 6, 1) do Timecop.freeze(2023, 6, 1) do
get "/sales-logs/bulk-upload-logs/guidance", params: {} get "/sales-logs/bulk-upload-logs/guidance?form%5Byear%5D=#{expected_year}", params: {}
expect(response.body).to include("How to upload logs in bulk") expect(response.body).to include("How to upload logs in bulk")
end end

Loading…
Cancel
Save