Browse Source

stub kernel call methods

pull/1043/head
Phil Lee 4 years ago
parent
commit
f1d81d9140
  1. 6
      spec/features/bulk_upload_lettings_logs_spec.rb
  2. 6
      spec/features/bulk_upload_sales_logs_spec.rb

6
spec/features/bulk_upload_lettings_logs_spec.rb

@ -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

6
spec/features/bulk_upload_sales_logs_spec.rb

@ -19,6 +19,7 @@ RSpec.describe "Bulk upload sales 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 sales 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::BulkUploadSales::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::BulkUploadSales::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 sales 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

Loading…
Cancel
Save