diff --git a/lib/tokyo_api/campact.rb b/lib/tokyo_api/campact.rb index 2002996..398027d 100644 --- a/lib/tokyo_api/campact.rb +++ b/lib/tokyo_api/campact.rb @@ -34,6 +34,10 @@ def user_path(session_id, petition_id:, with_subscription_status: false, require path end + def update_prefill_forms_path(session_id) + String.new("/#{normalized_base_path}user/#{url_escape(session_id)}/prefill_forms") + end + def subscription_status_path(token) "/#{normalized_base_path}subscription_status/#{url_escape(token)}" end diff --git a/spec/campact_spec.rb b/spec/campact_spec.rb index 2f6aab4..2d35ad3 100644 --- a/spec/campact_spec.rb +++ b/spec/campact_spec.rb @@ -117,6 +117,12 @@ end end + describe '#update_prefill_forms_path' do + it 'should return relative path to prefill forms endpoint' do + expect(subject.campact.update_prefill_forms_path('123abc456')).to eq '/campact/user/123abc456/prefill_forms' + end + end + describe '#subscription_status_path' do subject { TokyoApi::Campact.new }