gds-api-adapters 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gds_api/need_api.rb +5 -0
- data/lib/gds_api/version.rb +1 -1
- data/test/need_api_test.rb +17 -0
- metadata +3 -3
data/lib/gds_api/need_api.rb
CHANGED
@@ -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
|
data/lib/gds_api/version.rb
CHANGED
data/test/need_api_test.rb
CHANGED
@@ -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.
|
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:
|
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:
|
376
|
+
hash: 3966297796637980958
|
377
377
|
requirements: []
|
378
378
|
rubyforge_project:
|
379
379
|
rubygems_version: 1.8.23
|