|
|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
require "rails_helper" |
|
|
|
|
|
|
|
|
|
RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do |
|
|
|
|
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
|
|
|
|
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } |
|
|
|
|
|
|
|
|
|
let(:page_definition) { nil } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection) } |
|
|
|
|
let(:person_index) { 1 } |
|
|
|
|
|
|
|
|
|
context "without joint purchase" do |
|
|
|
|
let(:page_id) { "person_1_relationship_to_buyer_1" } |
|
|
|
|
@ -22,6 +23,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 1" do |
|
|
|
|
let(:person_index) { 2 } |
|
|
|
|
let(:page_id) { "person_1_relationship_to_buyer_1" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -38,6 +40,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 2" do |
|
|
|
|
let(:person_index) { 3 } |
|
|
|
|
let(:page_id) { "person_2_relationship_to_buyer_1" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -54,6 +57,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 3" do |
|
|
|
|
let(:person_index) { 4 } |
|
|
|
|
let(:page_id) { "person_3_relationship_to_buyer_1" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -70,6 +74,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 4" do |
|
|
|
|
let(:person_index) { 5 } |
|
|
|
|
let(:page_id) { "person_4_relationship_to_buyer_1" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -102,6 +107,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 1" do |
|
|
|
|
let(:person_index) { 3 } |
|
|
|
|
let(:page_id) { "person_1_relationship_to_buyer_1_joint_purchase" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -118,6 +124,8 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 2" do |
|
|
|
|
let(:person_index) { 4 } |
|
|
|
|
|
|
|
|
|
let(:page_id) { "person_2_relationship_to_buyer_1_joint_purchase" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -134,6 +142,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 3" do |
|
|
|
|
let(:person_index) { 5 } |
|
|
|
|
let(:page_id) { "person_3_relationship_to_buyer_1_joint_purchase" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
@ -150,6 +159,7 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with person 4" do |
|
|
|
|
let(:person_index) { 6 } |
|
|
|
|
let(:page_id) { "person_4_relationship_to_buyer_1_joint_purchase" } |
|
|
|
|
|
|
|
|
|
it "has correct questions" do |
|
|
|
|
|