Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint for feedback from Eu exit bus. finder #894

Merged
merged 1 commit into from
Jan 28, 2019
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: 4 additions & 0 deletions lib/gds_api/support_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def problem_report_daily_totals_for(date)
get_json("#{endpoint}/anonymous-feedback/problem-reports/#{date_string}/totals")
end

def create_business_finder_feedback(params)
post_json("#{endpoint}/anonymous-feedback/business-finder", params)
end

def anonymous_feedback(options = {})
uri = "#{endpoint}/anonymous-feedback" + query_string(options)
get_json(uri)
Expand Down
6 changes: 6 additions & 0 deletions lib/gds_api/test_helpers/support_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def stub_support_api_create_page_improvement(params)
post_stub.to_return(status: 201)
end

def stub_support_api_create_business_finder_feedback(params)
post_stub = stub_http_request(:post, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/business-finder")
post_stub.with(body: params)
post_stub.to_return(status: 201)
end

def stub_support_api_problem_report_daily_totals_for(date, expected_results = nil)
date_string = date.strftime("%Y-%m-%d")
get_stub = stub_http_request(:get, "#{SUPPORT_API_ENDPOINT}/anonymous-feedback/problem-reports/#{date_string}/totals")
Expand Down
9 changes: 9 additions & 0 deletions test/support_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
assert_requested(stub_post)
end

it 'can submit anonymous-contact/business-finder' do
request_details = { description: 'something is missing' }
stub_post = stub_support_api_create_business_finder_feedback(request_details)

@api.create_business_finder_feedback(request_details)

assert_requested(stub_post)
end

it "fetches problem report daily totals" do
response_body = { "data" => ["results"] }
request_date = Date.new(2014, 7, 12)
Expand Down