Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
816 B

CLDC-3541 Update sales financial validations (#2546) * CLDC-3569 Update social homebuy errors (#2541) * Split questions * Update the error message * Add guidance * Add back the headers * Refactor depends_on * Refactor further * CLDC-3569 Update missed errors (#2548) * Update some skipped error messages * Remove repeating deposit question * CLDC-3571 Discounted ownership validation (#2547) * Rename discount to deposit discount * Split about price rtb questions * Update error message * Update guidance partial * Fix top_guidance_partial method * Split about_price_not_rtb * Update guidance partial and validation * Fix bulk upload test * Update deposit routed_to and guidance * Refactor guidance links into a helper (#2551) * Refactor guidance links into a helper * Refactor discounted ownership guidance * CLDC-3570 Validations all other shared ownership types (#2550) * Update "all other shared ownership" errors * CLDC-3571 Update outright sale financial validations (#2549) * Update outright sale validation message * Add outright sale guidance * Update duplicate page id * User guidance helper * Fix up financial equations content (#2552) * Tweak shared ownership validation wording * Add top_guidance_partial to missed shared ownership questions * Update discounted ownership validation message when there's no grant * Update discounted sale guidance and errors * Lint and update test * Update BU test * Update test * CLDC-3569 Update guidance for shared ownership without mortgage (#2562) * Update how we display errors for BU * Update guidance for shared ownership * Add header to mortgage used question * Update shared ownership guidance * Update spacing (#2569) * Fix spacing again (#2570) * Update discounted ownership guidance (#2582) * Update discounted ownership guidance * Add top guidance partial to outright sale * Update outright sale guidance content * Update model test --------- Co-authored-by: Manny Dinssa <44172848+Dinssa@users.noreply.github.com>
4 months ago
require "rails_helper"
RSpec.describe GuidanceHelper do
describe "#question_link" do
context "when question page is routed to" do
let(:log) { create(:sales_log, :shared_ownership_setup_complete, mortgageused: 2) }
it "returns an empty string if question is not routed to" do
expect(question_link("mortgage", log, log.assigned_to)).to eq("")
end
end
context "when question page is not routed to" do
let(:log) { create(:sales_log, :shared_ownership_setup_complete, mortgageused: 1) }
it "returns a link to the question with correct question number in brakets" do
expect(question_link("mortgage", log, log.assigned_to)).to eq("(<a class=\"govuk-link\" href=\"/sales-logs/#{log.id}/mortgage-amount-shared-ownership\">Q92</a>)")
end
end
end
end