Skip to content

Commit

Permalink
Merge pull request #1243 from alphagov/remove-named-contact
Browse files Browse the repository at this point in the history
Remove exposed 'Named Contact' functionality from Support app
  • Loading branch information
ChrisBAshton authored Mar 26, 2024
2 parents 6e3dd40 + d36c42a commit d1809c4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 50 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Unreleased
# 95.0.0

* BREAKING: Drop 'named contact' API methods from Support app.
* Fix rack being only a development dependency as it is used at runtime.
* Fix too strict Ruby version constraint, loosened to Ruby 3.1

Expand Down
4 changes: 0 additions & 4 deletions lib/gds_api/support.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
require_relative "base"

class GdsApi::Support < GdsApi::Base
def create_named_contact(request_details)
post_json("#{base_url}/named_contacts", named_contact: request_details)
end

def feedback_url(slug)
"#{base_url}/anonymous_feedback?path=#{slug}"
end
Expand Down
23 changes: 0 additions & 23 deletions lib/gds_api/test_helpers/support.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/gds_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module GdsApi
VERSION = "94.0.0".freeze
VERSION = "95.0.0".freeze
end
21 changes: 0 additions & 21 deletions test/support_test.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
require "test_helper"
require "gds_api/support"
require "gds_api/test_helpers/support"

describe GdsApi::Support do
include GdsApi::TestHelpers::Support

before do
@base_api_url = Plek.find("support")
@api = GdsApi::Support.new(@base_api_url)
end

it "can create a named contact" do
request_details = { certain: "details" }

stub_post = stub_request(:post, "#{@base_api_url}/named_contacts")
.with(body: { "named_contact" => request_details }.to_json)
.to_return(status: 201)

@api.create_named_contact(request_details)

assert_requested(stub_post)
end

it "throws an exception when the support app isn't available while creating named contacts" do
stub_support_isnt_available

assert_raises(GdsApi::HTTPServerError) { @api.create_named_contact({}) }
end

it "gets the correct feedback URL" do
assert_equal(
"#{@base_api_url}/anonymous_feedback?path=foo",
Expand Down

0 comments on commit d1809c4

Please sign in to comment.