Browse Source

tests

pull/1721/head
Kat 2 years ago
parent
commit
1ef98d3cf9
  1. 4
      spec/requests/lettings_logs_controller_spec.rb
  2. 4
      spec/requests/sales_logs_controller_spec.rb

4
spec/requests/lettings_logs_controller_spec.rb

@ -943,7 +943,7 @@ RSpec.describe LettingsLogsController, type: :request do
completed_lettings_log.reload completed_lettings_log.reload
get "/lettings-logs/#{completed_lettings_log.id}", headers:, params: {} get "/lettings-logs/#{completed_lettings_log.id}", headers:, params: {}
expect(completed_lettings_log.form.new_logs_end_date).to eq(Time.zone.local(2023, 12, 31)) expect(completed_lettings_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 12, 31))
expect(completed_lettings_log.status).to eq("completed") expect(completed_lettings_log.status).to eq("completed")
expect(page).to have_link("review and make changes to this log", href: "/lettings-logs/#{completed_lettings_log.id}/review") expect(page).to have_link("review and make changes to this log", href: "/lettings-logs/#{completed_lettings_log.id}/review")
end end
@ -981,7 +981,7 @@ RSpec.describe LettingsLogsController, type: :request do
it "displays a closed collection window message for previous collection year logs" do it "displays a closed collection window message for previous collection year logs" do
get "/lettings-logs/#{completed_lettings_log.id}", headers:, params: {} get "/lettings-logs/#{completed_lettings_log.id}", headers:, params: {}
expect(completed_lettings_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 7, 1)) expect(completed_lettings_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 12, 31))
expect(completed_lettings_log.status).to eq("completed") expect(completed_lettings_log.status).to eq("completed")
follow_redirect! follow_redirect!
expect(page).to have_content("This log is from the 2021/2022 collection window, which is now closed.") expect(page).to have_content("This log is from the 2021/2022 collection window, which is now closed.")

4
spec/requests/sales_logs_controller_spec.rb

@ -588,7 +588,7 @@ RSpec.describe SalesLogsController, type: :request do
completed_sales_log.reload completed_sales_log.reload
get "/sales-logs/#{completed_sales_log.id}", headers:, params: {} get "/sales-logs/#{completed_sales_log.id}", headers:, params: {}
expect(completed_sales_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 8, 7)) expect(completed_sales_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 12, 31))
expect(completed_sales_log.status).to eq("completed") expect(completed_sales_log.status).to eq("completed")
expect(page).to have_link("review and make changes to this log", href: "/sales-logs/#{completed_sales_log.id}/review?sales_log=true") expect(page).to have_link("review and make changes to this log", href: "/sales-logs/#{completed_sales_log.id}/review?sales_log=true")
end end
@ -626,7 +626,7 @@ RSpec.describe SalesLogsController, type: :request do
it "displays a closed collection window message for previous collection year logs" do it "displays a closed collection window message for previous collection year logs" do
get "/sales-logs/#{completed_sales_log.id}", headers:, params: {} get "/sales-logs/#{completed_sales_log.id}", headers:, params: {}
expect(completed_sales_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 8, 7)) expect(completed_sales_log.form.new_logs_end_date).to eq(Time.zone.local(2022, 12, 31))
expect(completed_sales_log.status).to eq("completed") expect(completed_sales_log.status).to eq("completed")
follow_redirect! follow_redirect!
expect(page).to have_content("This log is from the 2021/2022 collection window, which is now closed.") expect(page).to have_content("This log is from the 2021/2022 collection window, which is now closed.")

Loading…
Cancel
Save