|
|
|
@ -1949,6 +1949,11 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
context "when positive" do |
|
|
|
context "when positive" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_10: "2", field_107: "100") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_10: "2", field_107: "100") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_107]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
@ -1956,9 +1961,29 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when set to 1" do |
|
|
|
|
|
|
|
let(:attributes) { valid_attributes.merge(field_10: "2", field_107: "1") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_107]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
|
|
|
|
log = parser.log |
|
|
|
|
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
|
|
|
|
expect(log["mscharge"]).to eq(1) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when set to 0" do |
|
|
|
context "when set to 0" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_10: "2", field_107: "0") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_10: "2", field_107: "0") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "adds a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_107]).to include(I18n.t("validations.sales.2026.bulk_upload.mscharge.invalid")) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to no and does not set mscharge" do |
|
|
|
it "sets has_mscharge to no and does not set mscharge" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["has_mscharge"]).to eq(0) |
|
|
|
expect(log["has_mscharge"]).to eq(0) |
|
|
|
@ -2016,6 +2041,11 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
context "when positive" do |
|
|
|
context "when positive" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_125: "100") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_125: "100") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_125]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
@ -2023,9 +2053,29 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when set to 1" do |
|
|
|
|
|
|
|
let(:attributes) { valid_attributes.merge(field_125: "1") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_125]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
|
|
|
|
log = parser.log |
|
|
|
|
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
|
|
|
|
expect(log["mscharge"]).to eq(1) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when set to 0" do |
|
|
|
context "when set to 0" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_125: "0") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_125: "0") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "adds a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_125]).to include(I18n.t("validations.sales.2026.bulk_upload.mscharge.invalid")) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to no and does not set mscharge" do |
|
|
|
it "sets has_mscharge to no and does not set mscharge" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["has_mscharge"]).to eq(0) |
|
|
|
expect(log["has_mscharge"]).to eq(0) |
|
|
|
@ -2083,6 +2133,11 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
context "when positive" do |
|
|
|
context "when positive" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_8: "2", field_136: "100") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_8: "2", field_136: "100") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_136]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
@ -2090,9 +2145,29 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when set to 1" do |
|
|
|
|
|
|
|
let(:attributes) { valid_attributes.merge(field_8: "2", field_136: "1") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_136]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to yes and mscharge to the value" do |
|
|
|
|
|
|
|
log = parser.log |
|
|
|
|
|
|
|
expect(log["has_mscharge"]).to eq(1) |
|
|
|
|
|
|
|
expect(log["mscharge"]).to eq(1) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when set to 0" do |
|
|
|
context "when set to 0" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_8: "2", field_136: "0") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_8: "2", field_136: "0") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "adds a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_136]).to include(I18n.t("validations.sales.2026.bulk_upload.mscharge.invalid")) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets has_mscharge to no and does not set mscharge" do |
|
|
|
it "sets has_mscharge to no and does not set mscharge" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["has_mscharge"]).to eq(0) |
|
|
|
expect(log["has_mscharge"]).to eq(0) |
|
|
|
@ -2150,6 +2225,11 @@ RSpec.describe BulkUpload::Sales::Year2026::RowParser do |
|
|
|
context "when positive" do |
|
|
|
context "when positive" do |
|
|
|
let(:attributes) { valid_attributes.merge(field_126: "150") } |
|
|
|
let(:attributes) { valid_attributes.merge(field_126: "150") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add a validation error" do |
|
|
|
|
|
|
|
parser.valid? |
|
|
|
|
|
|
|
expect(parser.errors[:field_126]).to be_blank |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "sets hasservicechargeschanged to yes and newservicecharges to the value" do |
|
|
|
it "sets hasservicechargeschanged to yes and newservicecharges to the value" do |
|
|
|
log = parser.log |
|
|
|
log = parser.log |
|
|
|
expect(log["hasservicechargeschanged"]).to eq(1) |
|
|
|
expect(log["hasservicechargeschanged"]).to eq(1) |
|
|
|
|