|
|
|
@ -19,6 +19,7 @@ RSpec.describe "Bulk upload lettings log" do |
|
|
|
sign_in user |
|
|
|
sign_in user |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# rubocop:disable RSpec/AnyInstance |
|
|
|
context "when during crossover period" do |
|
|
|
context "when during crossover period" do |
|
|
|
it "shows journey with year option" do |
|
|
|
it "shows journey with year option" do |
|
|
|
Timecop.freeze(2023, 6, 1) do |
|
|
|
Timecop.freeze(2023, 6, 1) do |
|
|
|
@ -44,10 +45,14 @@ RSpec.describe "Bulk upload lettings log" do |
|
|
|
expect(page).to have_content("Upload your file") |
|
|
|
expect(page).to have_content("Upload your file") |
|
|
|
click_button("Upload") |
|
|
|
click_button("Upload") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allow_any_instance_of(Forms::BulkUploadLettings::UploadYourFile).to receive(:`).and_return("not a csv") |
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_content("Select which file to upload") |
|
|
|
expect(page).to have_content("Select which file to upload") |
|
|
|
attach_file "file", file_fixture("2021_22_lettings_bulk_upload.xlsx") |
|
|
|
attach_file "file", file_fixture("2021_22_lettings_bulk_upload.xlsx") |
|
|
|
click_button("Upload") |
|
|
|
click_button("Upload") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allow_any_instance_of(Forms::BulkUploadLettings::UploadYourFile).to receive(:`).and_return("text/csv") |
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_content("Your file must be in CSV format") |
|
|
|
expect(page).to have_content("Your file must be in CSV format") |
|
|
|
attach_file "file", file_fixture("blank_bulk_upload_sales.csv") |
|
|
|
attach_file "file", file_fixture("blank_bulk_upload_sales.csv") |
|
|
|
expect { |
|
|
|
expect { |
|
|
|
@ -61,6 +66,7 @@ RSpec.describe "Bulk upload lettings log" do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
# rubocop:enable RSpec/AnyInstance |
|
|
|
|
|
|
|
|
|
|
|
context "when not it crossover period" do |
|
|
|
context "when not it crossover period" do |
|
|
|
it "shows journey with year option" do |
|
|
|
it "shows journey with year option" do |
|
|
|
|