Browse Source

Test assigned to validation when support

pull/2629/head
Manny Dinssa 2 years ago
parent
commit
4d4b2c6278
  1. 17
      spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb
  2. 17
      spec/services/bulk_upload/sales/year2024/row_parser_spec.rb

17
spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb

@ -815,6 +815,23 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
end end
end end
context "when blank and bulk upload user is support" do
let(:bulk_upload) { create(:bulk_upload, :sales, user: create(:user, :support), year: 2024) }
let(:attributes) { setup_section_params.merge(bulk_upload:, field_3: nil) }
it "is not permitted" do
parser.valid?
expect(parser.errors[:field_3]).to be_present
expect(parser.errors[:field_3]).to include("You must answer what is the CORE username of the account this letting log should be assigned to?")
end
it "blocks log creation" do
parser.valid?
expect(parser).to be_block_log_creation
end
end
context "when user could not be found" do context "when user could not be found" do
let(:attributes) { { bulk_upload:, field_3: "idonotexist@example.com" } } let(:attributes) { { bulk_upload:, field_3: "idonotexist@example.com" } }

17
spec/services/bulk_upload/sales/year2024/row_parser_spec.rb

@ -613,6 +613,23 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do
end end
end end
context "when blank and bulk upload user is support" do
let(:bulk_upload) { create(:bulk_upload, :sales, user: create(:user, :support), year: 2024) }
let(:attributes) { setup_section_params.merge(bulk_upload:, field_3: nil) }
it "is not permitted" do
parser.valid?
expect(parser.errors[:field_3]).to be_present
expect(parser.errors[:field_3]).to include("You must answer what is the CORE username of the account this sales log should be assigned to?")
end
it "blocks log creation" do
parser.valid?
expect(parser).to be_block_log_creation
end
end
context "when user could not be found" do context "when user could not be found" do
let(:attributes) { { bulk_upload:, field_3: "idonotexist@example.com" } } let(:attributes) { { bulk_upload:, field_3: "idonotexist@example.com" } }

Loading…
Cancel
Save