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.
29 lines
1.1 KiB
29 lines
1.1 KiB
2 years ago
|
require "rails_helper"
|
||
|
|
||
|
RSpec.describe FormPageHelper do
|
||
|
describe "#action_href" do
|
||
|
let(:lettings_log) { FactoryBot.create(:lettings_log) }
|
||
|
let(:sales_log) { FactoryBot.create(:sales_log) }
|
||
|
|
||
|
context "with a lettings log" do
|
||
|
it "has an update answer link href helper" do
|
||
|
expect(action_href(lettings_log, "net_income")).to eq("/lettings-logs/#{lettings_log.id}/net-income?referrer=check_answers")
|
||
|
end
|
||
|
|
||
|
it "returns a correct referrer in the url" do
|
||
|
expect(action_href(lettings_log, "retirement_value_check", "interruption_screen")).to eq("/lettings-logs/#{lettings_log.id}/retirement-value-check?referrer=interruption_screen")
|
||
|
end
|
||
|
end
|
||
|
|
||
|
context "with a sales log" do
|
||
|
it "has an update answer link href helper" do
|
||
|
expect(action_href(sales_log, "buyer_1_age")).to eq("/sales-logs/#{sales_log.id}/buyer-1-age?referrer=check_answers")
|
||
|
end
|
||
|
|
||
|
it "returns a correct referrer in the url" do
|
||
|
expect(action_href(sales_log, "grant_value_check", "interruption_screen")).to eq("/sales-logs/#{sales_log.id}/grant-value-check?referrer=interruption_screen")
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|