Browse Source

update test

pull/1249/head
Kat 3 years ago
parent
commit
2c75c058b5
  1. 34
      spec/models/form/sales/pages/person_known_spec.rb

34
spec/models/form/sales/pages/person_known_spec.rb

@ -7,7 +7,7 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do
let(:page_id) { "person_2_known" } let(:page_id) { "person_2_known" }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:subsection) { instance_double(Form::Subsection) }
let(:person_index) { 3 } let(:person_index) { 2 }
it "has correct subsection" do it "has correct subsection" do
expect(page.subsection).to eq(subsection) expect(page.subsection).to eq(subsection)
@ -41,8 +41,8 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do
expect(page.depends_on).to eq([{ expect(page.depends_on).to eq([{
"jointpur" => 2, "jointpur" => 2,
"hholdcount" => { "hholdcount" => {
"operand" => 1,
"operator" => ">=", "operator" => ">=",
"operand" => 1,
}, },
}]) }])
end end
@ -67,17 +67,19 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([ expect(page.depends_on).to eq([
{ {
"jointpur" => 2,
"hholdcount" => { "hholdcount" => {
"operand" => 2,
"operator" => ">=", "operator" => ">=",
"operand" => 2,
}, },
"jointpur" => 2,
}, },
{ {
"hholdcount" =>
{ "operand" => 1,
"operator" => ">=" },
"jointpur" => 1, "jointpur" => 1,
"hholdcount" => {
"operator" => ">=",
"operand" => 1,
},
}, },
]) ])
end end
@ -102,18 +104,18 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([ expect(page.depends_on).to eq([
{ {
"jointpur" => 2,
"hholdcount" => { "hholdcount" => {
"operand" => 3,
"operator" => ">=", "operator" => ">=",
"operand" => 3,
}, },
"jointpur" => 2,
}, },
{ {
"jointpur" => 1,
"hholdcount" => { "hholdcount" => {
"operand" => 2,
"operator" => ">=", "operator" => ">=",
"operand" => 2,
}, },
"jointpur" => 1,
}, },
]) ])
end end
@ -138,16 +140,18 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([ expect(page.depends_on).to eq([
{ {
"hholdcount" =>
{ "operand" => 4, "operator" => ">=" },
"jointpur" => 2, "jointpur" => 2,
"hholdcount" => {
"operator" => ">=",
"operand" => 4,
},
}, },
{ {
"jointpur" => 1,
"hholdcount" => { "hholdcount" => {
"operand" => 3,
"operator" => ">=", "operator" => ">=",
"operand" => 3,
}, },
"jointpur" => 1,
}, },
]) ])
end end

Loading…
Cancel
Save