discourse_api 0.28.0 → 0.28.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/discourse_api/api/users.rb +1 -1
- data/lib/discourse_api/version.rb +1 -1
- data/spec/discourse_api/api/groups_spec.rb +3 -2
- data/spec/discourse_api/api/users_spec.rb +16 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfbf0f7096f27cfc80d554849976a9b061ea3915b31b74b52b81bc5642376516
|
4
|
+
data.tar.gz: 0bfad1c8ee9a66154f9eb0e20f5e95d04173480f40616670697d54139ca16120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67f10c18d2ec354583ac205f0d0da1897147260d2822c87c0032357686b919602b7e6d3fff9966f00e5851eff9a1d6258239d40554dca8220ee6564eb16511dd
|
7
|
+
data.tar.gz: cbe23cec7233b872bc9efa2f9ff50fdf1805b6033ca410f38124fea8720d48077246dd4eadec747858576a70e296403d3b7c64347ca822a6e8c33cc20a1bc92f
|
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.28.1] - 2018-10-26
|
6
|
+
### Fixed
|
7
|
+
- Fixed non-URI chars in `check_username` method
|
8
|
+
|
5
9
|
## [0.28.0] - 2018-10-23
|
6
10
|
### Added
|
7
11
|
- Added `check_username` method
|
@@ -78,14 +78,15 @@ describe DiscourseApi::API::Groups do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
describe "remove members" do
|
81
|
+
let(:url) { "http://localhost:3000/admin/groups/123/members.json?api_key=test_d7fd0429940&api_username=test_user&usernames=sam" }
|
82
|
+
|
81
83
|
before do
|
82
|
-
url = "http://localhost:3000/admin/groups/123/members.json?api_key=test_d7fd0429940&api_username=test_user&username=sam"
|
83
84
|
stub_delete(url)
|
84
85
|
end
|
85
86
|
|
86
87
|
it "removes member" do
|
87
88
|
subject.group_remove(123, username: "sam")
|
88
|
-
expect(a_delete(
|
89
|
+
expect(a_delete(url)).to have_been_made
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
@@ -287,9 +287,9 @@ describe DiscourseApi::API::Users do
|
|
287
287
|
|
288
288
|
describe "#check_username" do
|
289
289
|
let(:url) { "http://localhost:3000/users/check_username.json?username=sparrow&api_key=test_d7fd0429940&api_username=test_user" }
|
290
|
+
let(:body) { '{"available":false,"suggestion":"sparrow1"}' }
|
290
291
|
|
291
292
|
before do
|
292
|
-
body = '{"available":false,"suggestion":"sparrow1"}'
|
293
293
|
stub_get(url).to_return(body: body, headers: { content_type: "application/json" })
|
294
294
|
end
|
295
295
|
|
@@ -302,5 +302,20 @@ describe DiscourseApi::API::Users do
|
|
302
302
|
result = subject.check_username("sparrow")
|
303
303
|
expect(result['available']).to eq false
|
304
304
|
end
|
305
|
+
|
306
|
+
context "when non-URI characters are used" do
|
307
|
+
let(:url) { "http://localhost:3000/users/check_username.json?username=1_%5B4%5D%21+%40the%24%23%3F&api_key=test_d7fd0429940&api_username=test_user" }
|
308
|
+
let(:body) { '{"errors":["must only include numbers, letters, dashes, and underscores"]}' }
|
309
|
+
|
310
|
+
it "escapes them" do
|
311
|
+
subject.check_username("1_[4]! @the$#?")
|
312
|
+
expect(a_get(url)).to have_been_made
|
313
|
+
end
|
314
|
+
|
315
|
+
it "returns the result" do
|
316
|
+
result = subject.check_username("1_[4]! @the$#?")
|
317
|
+
expect(result['errors'].first).to eq "must only include numbers, letters, dashes, and underscores"
|
318
|
+
end
|
319
|
+
end
|
305
320
|
end
|
306
321
|
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.28.
|
4
|
+
version: 0.28.1
|
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-10-
|
14
|
+
date: 2018-10-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|