gds-api-adapters 8.1.0 → 8.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,4 +32,9 @@ class GdsApi::NeedApi < GdsApi::Base
32
32
  # }
33
33
  put_json!("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}/closed", duplicate_of)
34
34
  end
35
+
36
+ def reopen(need_id, author)
37
+ # author params: { "author" => { ... } }"
38
+ delete_json!("#{endpoint}/needs/#{CGI.escape(need_id.to_s)}/closed", author)
39
+ end
35
40
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '8.1.0'
2
+ VERSION = '8.2.0'
3
3
  end
@@ -221,4 +221,21 @@ describe GdsApi::NeedApi do
221
221
  assert_requested duplicate_stub
222
222
  end
223
223
  end
224
+
225
+ describe "reopening closed needs" do
226
+ it "should send a DELETE request" do
227
+ fields = {
228
+ author: {
229
+ name: "Winston Smith-Churchill",
230
+ email: "winston@alphagov.co.uk"
231
+ }
232
+ }
233
+
234
+ reopen_stub = stub_request(:delete, @base_api_url + "/needs/100001/closed")
235
+ .with(body: fields.to_json)
236
+ .to_return(status: 204)
237
+ @api.reopen(100001, fields)
238
+ assert_requested reopen_stub
239
+ end
240
+ end
224
241
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0
4
+ version: 8.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -364,7 +364,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
364
364
  version: '0'
365
365
  segments:
366
366
  - 0
367
- hash: -1483996754784440811
367
+ hash: 3966297796637980958
368
368
  required_rubygems_version: !ruby/object:Gem::Requirement
369
369
  none: false
370
370
  requirements:
@@ -373,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  version: '0'
374
374
  segments:
375
375
  - 0
376
- hash: -1483996754784440811
376
+ hash: 3966297796637980958
377
377
  requirements: []
378
378
  rubyforge_project:
379
379
  rubygems_version: 1.8.23