Browse Source

feat: update linking behaviour (#938)

* feat: update linking behaviour

* feat: update linking behaviour for jointpur

* refactor: improve spacing
pull/941/head
natdeanlewissoftwire 2 years ago committed by GitHub
parent
commit
27f3046c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/models/form/sales/pages/buyer_company.rb
  2. 5
      app/models/form/sales/pages/joint_purchase.rb
  3. 6
      spec/models/form/sales/pages/buyer_company_spec.rb
  4. 8
      spec/models/form/sales/pages/joint_purchase_spec.rb

3
app/models/form/sales/pages/buyer_company.rb

@ -5,6 +5,9 @@ class Form::Sales::Pages::BuyerCompany < ::Form::Page
@header = ""
@description = ""
@subsection = subsection
@depends_on = [{
"ownershipsch" => 3,
}]
end
def questions

5
app/models/form/sales/pages/joint_purchase.rb

@ -5,6 +5,11 @@ class Form::Sales::Pages::JointPurchase < ::Form::Page
@header = ""
@description = ""
@subsection = subsection
@depends_on = [
{ "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
{ "companybuy" => 2 },
]
end
def questions

6
spec/models/form/sales/pages/buyer_company_spec.rb

@ -26,4 +26,10 @@ RSpec.describe Form::Sales::Pages::BuyerCompany, type: :model do
it "has the correct description" do
expect(page.description).to eq("")
end
it "has correct depends_on" do
expect(page.depends_on).to eq([{
"ownershipsch" => 3,
}])
end
end

8
spec/models/form/sales/pages/joint_purchase_spec.rb

@ -26,4 +26,12 @@ RSpec.describe Form::Sales::Pages::JointPurchase, type: :model do
it "has the correct description" do
expect(page.description).to eq("")
end
it "has correct depends_on" do
expect(page.depends_on).to eq([
{ "ownershipsch" => 1 },
{ "ownershipsch" => 2 },
{ "companybuy" => 2 },
])
end
end

Loading…
Cancel
Save