Browse Source
* initial spec file refactor remove create for build, extract form to own variable, remove non-valuable tests run time from 0.29s to0.11s * refactor to ensure that the questions ownershipsch instance variable and the value of ownershipsch on the log is the same in tests * delete page test file which is not testing anything meaningful * add error messages to the I18n yml * update tests for the validations * update validation logic * update tests for the mortgage used question * update the mortgage used question displayed answer options * update bulk upload specs to reflect error message updates * make use of brackets consistent within validation methodpull/2462/head
Arthur Campbell
7 months ago
committed by
GitHub
8 changed files with 193 additions and 145 deletions
@ -1,29 +0,0 @@
|
||||
require "rails_helper" |
||||
|
||||
RSpec.describe Form::Sales::Pages::Mortgageused, type: :model do |
||||
subject(:page) { described_class.new(page_id, page_definition, subsection, ownershipsch: 1) } |
||||
|
||||
let(:page_id) { "mortgage_used" } |
||||
let(:page_definition) { nil } |
||||
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) } |
||||
|
||||
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[mortgageused]) |
||||
end |
||||
|
||||
it "has the correct id" do |
||||
expect(page.id).to eq("mortgage_used") |
||||
end |
||||
|
||||
it "has the correct header" do |
||||
expect(page.header).to be_nil |
||||
end |
||||
|
||||
it "has the correct description" do |
||||
expect(page.description).to be_nil |
||||
end |
||||
end |
Loading…
Reference in new issue