Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/services/sp_return_url_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def homepage_url
end

def post_idv_follow_up_url
service_provider.post_idv_follow_up_url || homepage_url
url = service_provider.post_idv_follow_up_url || homepage_url
return if url.blank?
format(url.to_s, locale: I18n.locale.to_s)
end

private
Expand Down
8 changes: 8 additions & 0 deletions spec/services/sp_return_url_resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,13 @@

it { expect(post_idv_follow_up_url).to eq(sp_post_idv_follow_up_url) }
end

context 'with a template param in the URL' do
let(:sp_post_idv_follow_up_url) { 'https://sp.gov/follow_up?locale=%{locale}' }

it 'interpolates the appropriate value' do
expect(post_idv_follow_up_url).to eq('https://sp.gov/follow_up?locale=en')
end
end
end
end