Browse Source

feat: update tests

pull/1538/head
natdeanlewissoftwire 2 years ago
parent
commit
ddcb94450c
  1. 16
      app/models/form/lettings/pages/min_rent_value_check.rb
  2. 2
      db/schema.rb
  3. 2
      spec/models/form/lettings/pages/max_rent_value_check_spec.rb
  4. 11
      spec/models/form/lettings/pages/min_rent_value_check_spec.rb

16
app/models/form/lettings/pages/min_rent_value_check.rb

@ -12,15 +12,13 @@ class Form::Lettings::Pages::MinRentValueCheck < ::Form::Page
}
@informative_text = {
"translation" => "soft_validations.rent.min_hint_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
"arguments_for_key" => "soft_min_for_period",
"i18n_template" => "soft_min_for_period",
},
],
},
@check_answers_card_number = check_answers_card_number
"arguments" => [{
"key" => "field_formatted_as_currency",
"arguments_for_key" => "soft_min_for_period",
"i18n_template" => "soft_min_for_period",
}],
}
@check_answers_card_number = check_answers_card_number
end
def questions

2
db/schema.rb

@ -573,8 +573,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_12_143245) do
t.integer "nationalbuy2"
t.integer "discounted_sale_value_check"
t.integer "student_not_child_value_check"
t.integer "buyer_livein_value_check"
t.integer "percentage_discount_value_check"
t.integer "buyer_livein_value_check"
t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"
t.index ["old_id"], name: "index_sales_logs_on_old_id", unique: true

2
spec/models/form/lettings/pages/max_rent_value_check_spec.rb

@ -3,7 +3,7 @@ require "rails_helper"
RSpec.describe Form::Lettings::Pages::MaxRentValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { "shared_ownership_deposit_value_check" }
let(:page_id) { "max_rent_value_check" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }

11
spec/models/form/lettings/pages/min_rent_value_check_spec.rb

@ -1,8 +1,9 @@
require "rails_helper"
RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do
subject(:page) { described_class.new(nil, page_definition, subsection) }
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { "max_rent_value_check" }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
@ -41,8 +42,14 @@ RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do
it "has the correct informative_text" do
expect(page.informative_text).to eq({
"arguments" => [{ "arguments_for_key" => "soft_min_for_period", "i18n_template" => "soft_min_for_period", "key" => "field_formatted_as_currency" }],
"translation" => "soft_validations.rent.min_hint_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
"arguments_for_key" => "soft_min_for_period",
"i18n_template" => "soft_min_for_period",
},
],
})
end
end

Loading…
Cancel
Save