discourse_api 0.6.2 → 0.7.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: f8d1504d9f6215e61f1b9038809f8663eaa566b8
4
- data.tar.gz: b4ed50ba139c359d2a33b96a26b9c851431abb9c
3
+ metadata.gz: 6c0790579478eedc23d1ee9c2845584fc2eeb35e
4
+ data.tar.gz: 4fc797b4a90520a46f7ac3b64c51fb8129868149
5
5
  SHA512:
6
- metadata.gz: 414204490efeb376d200c2fce194d031d383af3da1f59825d3268359c480264d7f36468a9c2f1476fec3eaa41e1fa87f925661430bea225503cb7062136166f6
7
- data.tar.gz: ce5ca8d555c8d0a8f4250c8597870ae64c8e4604bfa3c00322dce468214c0e6dea87e3ed59d8802c230607ef961e10872f679f56e4195e59b52539484890b1ce
6
+ metadata.gz: 2ff4ce4800eca2118a78afc0953b65fe1786b6dd0ba1889909e8054ec21e7fdb4c1006b771d149571bc73e63df1ae88ac56849d49d5e31df654945150dff1a42
7
+ data.tar.gz: 23a89130ee7d7976895713207a95dbec071b6108a7f3d22ef6f3d91c68388004888af27be422907b4667df40200a9af4c321f4d54e7ee20605c2053d790465ff
@@ -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.7.0] - 2015-12-09
6
+ ### Added
7
+ - get user by external_id
8
+
5
9
  ## [0.6.2] - 2015-12-02
6
10
  ### Fixed
7
11
  - `API::Params` will not work correctly when both optional and defaults are
@@ -6,8 +6,8 @@ require 'discourse_api/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "discourse_api"
8
8
  spec.version = DiscourseApi::VERSION
9
- spec.authors = ["Sam Saffron", "John Paul Ashenfelter", "Michael Herold"]
10
- spec.email = ["sam.saffron@gmail.com", "john@ashenfelter.com", "michael.j.herold@gmail.com"]
9
+ spec.authors = ["Sam Saffron", "John Paul Ashenfelter", "Michael Herold", "Blake Erickson"]
10
+ spec.email = ["sam.saffron@gmail.com", "john@ashenfelter.com", "michael.j.herold@gmail.com", "o.blakeerickson@gmail.com"]
11
11
  spec.description = %q{Discourse API}
12
12
  spec.summary = %q{Allows access to the Discourse API}
13
13
  spec.homepage = "http://github.com/discourse/discourse_api"
@@ -75,6 +75,11 @@ module DiscourseApi
75
75
  response = put("admin/users/#{user_id}/revoke_admin")
76
76
  response[:body]
77
77
  end
78
+
79
+ def by_external_id(external_id)
80
+ response = get("/users/by-external/#{external_id}")
81
+ response[:body]['user']
82
+ end
78
83
  end
79
84
  end
80
85
  end
@@ -1,3 +1,3 @@
1
1
  module DiscourseApi
2
- VERSION = "0.6.2"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -208,4 +208,20 @@ describe DiscourseApi::API::Users do
208
208
  expect(result['admin_user']['admin']).to eq(true)
209
209
  end
210
210
  end
211
+
212
+ describe "#by_external_id" do
213
+ before do
214
+ stub_get("http://localhost:3000/users/by-external/1?api_key=test_d7fd0429940&api_username=test_user").to_return(body: fixture("user.json"), headers: { content_type: "application/json" })
215
+ end
216
+
217
+ it "requests the correct resource" do
218
+ subject.by_external_id(1)
219
+ expect(a_get("http://localhost:3000/users/by-external/1?api_key=test_d7fd0429940&api_username=test_user")).to have_been_made
220
+ end
221
+
222
+ it "returns the requested user" do
223
+ user = subject.by_external_id(1)
224
+ expect(user['id']).to eq 1
225
+ end
226
+ end
211
227
  end
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  - John Paul Ashenfelter
9
9
  - Michael Herold
10
+ - Blake Erickson
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2015-12-02 00:00:00.000000000 Z
14
+ date: 2015-12-09 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: faraday
@@ -171,6 +172,7 @@ email:
171
172
  - sam.saffron@gmail.com
172
173
  - john@ashenfelter.com
173
174
  - michael.j.herold@gmail.com
175
+ - o.blakeerickson@gmail.com
174
176
  executables: []
175
177
  extensions: []
176
178
  extra_rdoc_files: []