discourse_api 0.18.0 → 0.19.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/discourse_api/api/groups.rb +5 -0
- data/lib/discourse_api/api/posts.rb +1 -0
- data/lib/discourse_api/version.rb +1 -1
- data/spec/discourse_api/api/groups_spec.rb +6 -0
- data/spec/fixtures/group.json +9 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83abc19a3d7e268f4e7bbed2ba58af029149bf8f
|
4
|
+
data.tar.gz: a355175ab4498a2d02f2cbb340b48987770882ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5db56a7d1101b1568cd51e52dee5df79651697c11f84c83e9b5c4e7c73336689e34a8e0ea1e6eb72f082c6efb6e61056b2ce5ac6c732acb355aff6a9044c0781
|
7
|
+
data.tar.gz: 98317ae29f5fc092f5126f988d35c73e29eb46baab5264fab7dd7e96fa6b73b643dd558121d5ef003736a2dd7c2d2beba22e0e3e5cf88c976a75b78cb760f1a5
|
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.19.0] - 2017-11-22
|
6
|
+
### Added
|
7
|
+
- Added optional `create_post` params
|
8
|
+
|
5
9
|
## [0.18.0] - 2017-10-17
|
6
10
|
### Added
|
7
11
|
- Added update_group API call
|
@@ -62,6 +62,11 @@ module DiscourseApi
|
|
62
62
|
response.body
|
63
63
|
end
|
64
64
|
|
65
|
+
def group(group_name)
|
66
|
+
response = get("/groups/#{group_name}.json")
|
67
|
+
response.body
|
68
|
+
end
|
69
|
+
|
65
70
|
def group_add(group_id, users)
|
66
71
|
users.keys.each do |key|
|
67
72
|
# Accept arrays and convert to comma-delimited string.
|
@@ -19,6 +19,12 @@ describe DiscourseApi::API::Groups do
|
|
19
19
|
groups.each { |g| expect(g).to be_a Hash }
|
20
20
|
end
|
21
21
|
|
22
|
+
it "returns a single group" do
|
23
|
+
stub_get("http://localhost:3000/groups/some-group.json?api_key=test_d7fd0429940&api_username=test_user").to_return(body: fixture("group.json"), headers: { content_type: "application/json" })
|
24
|
+
group = subject.group('some-group')
|
25
|
+
expect(group['basic_group']).to be_a Hash
|
26
|
+
end
|
27
|
+
|
22
28
|
it "create new groups" do
|
23
29
|
stub_post("http://localhost:3000/admin/groups?api_key=test_d7fd0429940&api_username=test_user")
|
24
30
|
subject.create_group(name: "test_group")
|
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.
|
4
|
+
version: 0.19.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: 2017-
|
14
|
+
date: 2017-11-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- spec/fixtures/email_settings.json
|
258
258
|
- spec/fixtures/generate_api_key.json
|
259
259
|
- spec/fixtures/generate_master_key.json
|
260
|
+
- spec/fixtures/group.json
|
260
261
|
- spec/fixtures/groups.json
|
261
262
|
- spec/fixtures/hot.json
|
262
263
|
- spec/fixtures/latest.json
|
@@ -338,6 +339,7 @@ test_files:
|
|
338
339
|
- spec/fixtures/email_settings.json
|
339
340
|
- spec/fixtures/generate_api_key.json
|
340
341
|
- spec/fixtures/generate_master_key.json
|
342
|
+
- spec/fixtures/group.json
|
341
343
|
- spec/fixtures/groups.json
|
342
344
|
- spec/fixtures/hot.json
|
343
345
|
- spec/fixtures/latest.json
|