discourse_api 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9d51b2cfe49d9321e7e800f2546744bdde713de
4
- data.tar.gz: c5e3166b88afe5648610a67b4657fb3dfa371edb
3
+ metadata.gz: ee44c6527e47d55c63c5353e2809ade365badbe4
4
+ data.tar.gz: 145d522257eab65469e2c7ea4eb4de5a8c3f3fc9
5
5
  SHA512:
6
- metadata.gz: 59dea74713ae2c6db273a223cfda6f3a825c77cfd2643feb3e6b34b19690ac6e3c394b03903493fd0349e0e4c55a483f7d4cfe78e4645315b528341815918fb5
7
- data.tar.gz: e73d1365e79c1bf4bf0f4d546234b9f56919561b8b54004f3094ba1467b5279b9891835275fb9104cd903224b4b1cf210c63364774062271cafd7efed8caf029
6
+ metadata.gz: 41a5eff5e2224de784c3da8b595519f97fb210e8d48fe28f1170c59c2142a515ac6c2fc73b152c72221f6153e6dffe4dd1ccff3768fec7cd5136ec27dffa1ad5
7
+ data.tar.gz: 8fcd43d8a93551be14075e70672a88416c3246881b8bc996276310a6262d67ce23e7000c35257ccddb54851f26d11c5cd2d28c3cac05b21bc64df5e192c9f207
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [0.23.0] - 2018-05-24
6
+ ### Added
7
+ - Added `delete_user` method
8
+
5
9
  ## [0.22.0] - 2018-05-04
6
10
  ### Added
7
11
  - Support for subfolder paths
@@ -23,7 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
23
27
 
24
28
  ## [0.18.0] - 2017-10-17
25
29
  ### Added
26
- - Added update_group API call
30
+ - Added `update_group` API call
27
31
  ### Fixed
28
32
  - Fixed params for create groups endpoint
29
33
  - Fixed invite token API endpoint
@@ -88,6 +88,10 @@ module DiscourseApi
88
88
  def unsuspend(user_id)
89
89
  put("/admin/users/#{user_id}/unsuspend")
90
90
  end
91
+
92
+ def delete_user(user_id, delete_posts = false)
93
+ delete("/admin/users/#{user_id}.json?delete_posts=#{delete_posts}")
94
+ end
91
95
  end
92
96
  end
93
97
  end
@@ -1,3 +1,3 @@
1
1
  module DiscourseApi
2
- VERSION = "0.22.0"
2
+ VERSION = "0.23.0"
3
3
  end
@@ -269,4 +269,19 @@ describe DiscourseApi::API::Users do
269
269
  expect(result.status).to eq(200)
270
270
  end
271
271
  end
272
+
273
+ describe "#delete_user" do
274
+ before do
275
+ url = "http://localhost:3000/admin/users/11.json?delete_posts=true&api_key=test_d7fd0429940&api_username=test_user"
276
+ stub_delete(url).to_return(body: '{"deleted": true}', status: 200)
277
+ end
278
+
279
+ it "makes the correct delete request" do
280
+ result = subject.delete_user(11, true)
281
+ url = "http://localhost:3000/admin/users/11.json?delete_posts=true&api_key=test_d7fd0429940&api_username=test_user"
282
+ expect(a_delete(url)).to have_been_made
283
+ expect(result.body).to eq('{"deleted": true}')
284
+ expect(result.status).to eq(200)
285
+ end
286
+ end
272
287
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-05-04 00:00:00.000000000 Z
14
+ date: 2018-05-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday