8 changed files with 9 additions and 161 deletions
@ -1,15 +0,0 @@ |
|||||||
class Form::Sales::Pages::AboutDeposit < ::Form::Page |
|
||||||
def initialize(id, hsh, subsection) |
|
||||||
super |
|
||||||
@header = "About the deposit" |
|
||||||
@description = "" |
|
||||||
@subsection = subsection |
|
||||||
end |
|
||||||
|
|
||||||
def questions |
|
||||||
@questions ||= [ |
|
||||||
Form::Sales::Questions::DepositAmount.new(nil, nil, self), |
|
||||||
Form::Sales::Questions::DepositDiscount.new(nil, nil, self), |
|
||||||
] |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,18 +0,0 @@ |
|||||||
class Form::Sales::Pages::AboutPrice < ::Form::Page |
|
||||||
def initialize(id, hsh, subsection) |
|
||||||
super |
|
||||||
@id = "about_price" |
|
||||||
@header = "About the price of the property" |
|
||||||
@description = "" |
|
||||||
@subsection = subsection |
|
||||||
@depends_on = [{ |
|
||||||
"soctenant" => 2, |
|
||||||
}] |
|
||||||
end |
|
||||||
|
|
||||||
def questions |
|
||||||
@questions ||= [ |
|
||||||
Form::Sales::Questions::Value.new(nil, nil, self), |
|
||||||
] |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,19 +0,0 @@ |
|||||||
class Form::Sales::Pages::AboutPriceSocialHousing < ::Form::Page |
|
||||||
def initialize(id, hsh, subsection) |
|
||||||
super |
|
||||||
@id = "about_price_social_housing" |
|
||||||
@header = "About the price of the property" |
|
||||||
@description = "" |
|
||||||
@subsection = subsection |
|
||||||
@depends_on = [{ |
|
||||||
"soctenant" => 1, |
|
||||||
}] |
|
||||||
end |
|
||||||
|
|
||||||
def questions |
|
||||||
@questions ||= [ |
|
||||||
Form::Sales::Questions::Value.new(nil, nil, self), |
|
||||||
Form::Sales::Questions::Equity.new(nil, nil, self), |
|
||||||
] |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,33 +0,0 @@ |
|||||||
require "rails_helper" |
|
||||||
|
|
||||||
RSpec.describe Form::Sales::Pages::AboutDeposit, type: :model do |
|
||||||
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
|
||||||
|
|
||||||
let(:page_id) { nil } |
|
||||||
let(:page_definition) { nil } |
|
||||||
let(:subsection) { instance_double(Form::Subsection) } |
|
||||||
|
|
||||||
it "has correct subsection" do |
|
||||||
expect(page.subsection).to eq(subsection) |
|
||||||
end |
|
||||||
|
|
||||||
it "has correct questions" do |
|
||||||
expect(page.questions.map(&:id)).to eq(%w[deposit cashdis]) |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct id" do |
|
||||||
expect(page.id).to eq(nil) |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct header" do |
|
||||||
expect(page.header).to eq("About the deposit") |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct description" do |
|
||||||
expect(page.description).to eq("") |
|
||||||
end |
|
||||||
|
|
||||||
it "has correct depends_on" do |
|
||||||
expect(page.depends_on).to be_nil |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,35 +0,0 @@ |
|||||||
require "rails_helper" |
|
||||||
|
|
||||||
RSpec.describe Form::Sales::Pages::AboutPriceSocialHousing, type: :model do |
|
||||||
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
|
||||||
|
|
||||||
let(:page_id) { nil } |
|
||||||
let(:page_definition) { nil } |
|
||||||
let(:subsection) { instance_double(Form::Subsection) } |
|
||||||
|
|
||||||
it "has correct subsection" do |
|
||||||
expect(page.subsection).to eq(subsection) |
|
||||||
end |
|
||||||
|
|
||||||
it "has correct questions" do |
|
||||||
expect(page.questions.map(&:id)).to eq(%w[value equity]) |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct id" do |
|
||||||
expect(page.id).to eq("about_price_social_housing") |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct header" do |
|
||||||
expect(page.header).to eq("About the price of the property") |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct description" do |
|
||||||
expect(page.description).to eq("") |
|
||||||
end |
|
||||||
|
|
||||||
it "has correct depends_on" do |
|
||||||
expect(page.depends_on).to eq([{ |
|
||||||
"soctenant" => 1, |
|
||||||
}]) |
|
||||||
end |
|
||||||
end |
|
||||||
@ -1,35 +0,0 @@ |
|||||||
require "rails_helper" |
|
||||||
|
|
||||||
RSpec.describe Form::Sales::Pages::AboutPrice, type: :model do |
|
||||||
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
|
||||||
|
|
||||||
let(:page_id) { nil } |
|
||||||
let(:page_definition) { nil } |
|
||||||
let(:subsection) { instance_double(Form::Subsection) } |
|
||||||
|
|
||||||
it "has correct subsection" do |
|
||||||
expect(page.subsection).to eq(subsection) |
|
||||||
end |
|
||||||
|
|
||||||
it "has correct questions" do |
|
||||||
expect(page.questions.map(&:id)).to eq(%w[value]) |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct id" do |
|
||||||
expect(page.id).to eq("about_price") |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct header" do |
|
||||||
expect(page.header).to eq("About the price of the property") |
|
||||||
end |
|
||||||
|
|
||||||
it "has the correct description" do |
|
||||||
expect(page.description).to eq("") |
|
||||||
end |
|
||||||
|
|
||||||
it "has correct depends_on" do |
|
||||||
expect(page.depends_on).to eq([{ |
|
||||||
"soctenant" => 2, |
|
||||||
}]) |
|
||||||
end |
|
||||||
end |
|
||||||
Loading…
Reference in new issue