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
22 lines
816 B
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
|