discourse_api 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +21 -21
- data/.travis.yml +5 -7
- data/CHANGELOG.md +99 -85
- data/Gemfile +4 -4
- data/Guardfile +5 -5
- data/LICENSE.txt +22 -22
- data/README.md +73 -73
- data/Rakefile +7 -7
- data/discourse_api.gemspec +35 -33
- data/examples/backups.rb +18 -18
- data/examples/category.rb +21 -21
- data/examples/change_topic_status.rb +33 -0
- data/examples/create_topic.rb +23 -23
- data/examples/create_user.rb +14 -14
- data/examples/dashboard.rb +13 -13
- data/examples/disposable_invite_tokens.rb +18 -18
- data/examples/example.rb +9 -9
- data/examples/groups.rb +25 -25
- data/examples/invite_users.rb +15 -15
- data/examples/post_action.rb +25 -25
- data/examples/search.rb +9 -9
- data/examples/sso.rb +14 -14
- data/examples/topic_lists.rb +15 -15
- data/examples/update_user.rb +22 -22
- data/lib/discourse_api.rb +5 -5
- data/lib/discourse_api/api/api_key.rb +31 -31
- data/lib/discourse_api/api/backups.rb +24 -24
- data/lib/discourse_api/api/badges.rb +28 -28
- data/lib/discourse_api/api/categories.rb +57 -57
- data/lib/discourse_api/api/dashboard.rb +24 -24
- data/lib/discourse_api/api/email.rb +15 -15
- data/lib/discourse_api/api/groups.rb +52 -52
- data/lib/discourse_api/api/invite.rb +17 -17
- data/lib/discourse_api/api/notifications.rb +9 -9
- data/lib/discourse_api/api/params.rb +55 -55
- data/lib/discourse_api/api/posts.rb +41 -42
- data/lib/discourse_api/api/private_messages.rb +10 -10
- data/lib/discourse_api/api/search.rb +19 -19
- data/lib/discourse_api/api/sso.rb +22 -22
- data/lib/discourse_api/api/tags.rb +10 -10
- data/lib/discourse_api/api/topics.rb +78 -65
- data/lib/discourse_api/api/users.rb +85 -85
- data/lib/discourse_api/client.rb +133 -133
- data/lib/discourse_api/error.rb +17 -17
- data/lib/discourse_api/single_sign_on.rb +110 -110
- data/lib/discourse_api/version.rb +3 -3
- data/routes.txt +203 -203
- data/spec/discourse_api/api/api_key_spec.rb +121 -121
- data/spec/discourse_api/api/backups_spec.rb +23 -23
- data/spec/discourse_api/api/badges_spec.rb +40 -40
- data/spec/discourse_api/api/categories_spec.rb +87 -87
- data/spec/discourse_api/api/email_spec.rb +39 -39
- data/spec/discourse_api/api/groups_spec.rb +94 -94
- data/spec/discourse_api/api/notifications_spec.rb +24 -24
- data/spec/discourse_api/api/params_spec.rb +32 -32
- data/spec/discourse_api/api/posts_spec.rb +41 -29
- data/spec/discourse_api/api/private_messages_spec.rb +22 -22
- data/spec/discourse_api/api/search_spec.rb +30 -30
- data/spec/discourse_api/api/sso_spec.rb +16 -16
- data/spec/discourse_api/api/topics_spec.rb +113 -113
- data/spec/discourse_api/api/users_spec.rb +227 -227
- data/spec/discourse_api/client_spec.rb +115 -115
- data/spec/fixtures/api.json +12 -12
- data/spec/fixtures/backups.json +12 -12
- data/spec/fixtures/badges.json +569 -569
- data/spec/fixtures/categories.json +72 -72
- data/spec/fixtures/category_latest_topics.json +92 -92
- data/spec/fixtures/category_topics.json +91 -91
- data/spec/fixtures/email_list_all.json +749 -749
- data/spec/fixtures/email_settings.json +13 -13
- data/spec/fixtures/generate_api_key.json +12 -12
- data/spec/fixtures/generate_master_key.json +7 -7
- data/spec/fixtures/groups.json +18 -18
- data/spec/fixtures/hot.json +113 -113
- data/spec/fixtures/latest.json +115 -115
- data/spec/fixtures/members_0.json +403 -403
- data/spec/fixtures/members_1.json +363 -363
- data/spec/fixtures/new.json +113 -113
- data/spec/fixtures/notifications.json +16 -16
- data/spec/fixtures/post.json +94 -94
- data/spec/fixtures/post_action_users.json +18 -0
- data/spec/fixtures/private_messages.json +69 -69
- data/spec/fixtures/regenerate_api_key.json +7 -7
- data/spec/fixtures/search.json +24 -24
- data/spec/fixtures/topic.json +739 -739
- data/spec/fixtures/topic_invite_user.json +3 -3
- data/spec/fixtures/topics_created_by.json +49 -49
- data/spec/fixtures/update_trust_level.json +37 -37
- data/spec/fixtures/upload_avatar.json +13 -13
- data/spec/fixtures/user.json +65 -65
- data/spec/fixtures/user_activate_success.json +3 -3
- data/spec/fixtures/user_badges.json +170 -170
- data/spec/fixtures/user_create_success.json +5 -5
- data/spec/fixtures/user_grant_admin.json +37 -37
- data/spec/fixtures/user_list.json +583 -583
- data/spec/fixtures/user_log_out_success.json +3 -3
- data/spec/fixtures/user_update_avatar_success.json +3 -3
- data/spec/fixtures/user_update_user.json +3 -3
- data/spec/fixtures/user_update_username.json +4 -4
- data/spec/spec_helper.rb +61 -61
- metadata +31 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b96cb437020181b21b8ee3d42e65483029431aaa
|
4
|
+
data.tar.gz: e78ccede0ae62ae085a66b704a5f89d2299a6236
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eff3f9a2d5ebdb95776dde3d3b64eba61699ea73d4a467ac8be6a6994dae5bfae8bc097769ec0f4b5b8804921e7db656b685173d15c3b10ecc6943af16a22d9
|
7
|
+
data.tar.gz: 9582bf8fc7278050d8638d288904c5ab922ae1eef85850aef1086853b0f721d57b662aca741b025970aef96bd2935c1e0759dee6bf713acfbdb35b6a61a3b62c
|
data/.gitignore
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
bin/
|
19
|
-
.ruby-gemset
|
20
|
-
.ruby-version
|
21
|
-
.env
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
bin/
|
19
|
+
.ruby-gemset
|
20
|
+
.ruby-version
|
21
|
+
.env
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,85 +1,99 @@
|
|
1
|
-
# Change Log
|
2
|
-
All notable changes to this project will be documented in this file.
|
3
|
-
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
-
|
5
|
-
## [0.
|
6
|
-
###
|
7
|
-
-
|
8
|
-
|
9
|
-
###
|
10
|
-
-
|
11
|
-
-
|
12
|
-
|
13
|
-
## [0.
|
14
|
-
### Fixed
|
15
|
-
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
-
|
30
|
-
|
31
|
-
## [0.
|
32
|
-
### Added
|
33
|
-
-
|
34
|
-
|
35
|
-
## [0.
|
36
|
-
### Fixed
|
37
|
-
-
|
38
|
-
|
39
|
-
|
40
|
-
## [0.
|
41
|
-
###
|
42
|
-
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [0.11.0] - 2016-09-03
|
6
|
+
### Fixed
|
7
|
+
- add destination folder to backup download
|
8
|
+
- `post_action_users`
|
9
|
+
### Added
|
10
|
+
- `change_topic_status`
|
11
|
+
- set username of topic on creation
|
12
|
+
|
13
|
+
## [0.10.1] - 2016-05-04
|
14
|
+
### Fixed
|
15
|
+
- raise an error if search is empty
|
16
|
+
- fix /category path to be just /c
|
17
|
+
- return errors for category_latest_topics if there are some
|
18
|
+
|
19
|
+
## [0.10.0] - 2016-04-19
|
20
|
+
### Added
|
21
|
+
- group_members: Allows you to retrieve more than 100 users with pagination (offset &
|
22
|
+
limit)
|
23
|
+
### Fixed
|
24
|
+
- Deprication warning with SimpleCov
|
25
|
+
- updated rack dependency and added ruby 2.3 to travis config
|
26
|
+
|
27
|
+
## [0.9.1] - 2016-03-23
|
28
|
+
### Fixed
|
29
|
+
- topic and post like/flag need to use `:id`
|
30
|
+
|
31
|
+
## [0.9.0] - 2016-03-22
|
32
|
+
### Added
|
33
|
+
- can now like/flag topics and posts
|
34
|
+
|
35
|
+
## [0.8.1] - 2016-03-03
|
36
|
+
### Fixed
|
37
|
+
- enable use of discourse_api to make unauthenticated requests to discourse
|
38
|
+
endpoints like /categories and /topics
|
39
|
+
|
40
|
+
## [0.8.0] - 2016-02-28
|
41
|
+
### Added
|
42
|
+
- get stats from admin dashboard
|
43
|
+
- get only stat totals from admin dashboard
|
44
|
+
|
45
|
+
## [0.7.0] - 2015-12-09
|
46
|
+
### Added
|
47
|
+
- get user by external_id
|
48
|
+
|
49
|
+
## [0.6.2] - 2015-12-02
|
50
|
+
### Fixed
|
51
|
+
- `API::Params` will not work correctly when both optional and defaults are
|
52
|
+
specified
|
53
|
+
|
54
|
+
## [0.6.1] - 2015-11-28
|
55
|
+
### Fixed
|
56
|
+
- typo in topic_posts method
|
57
|
+
|
58
|
+
## [0.6.0] - 2015-11-27
|
59
|
+
### Added
|
60
|
+
- get posts in topic by an array of id's
|
61
|
+
|
62
|
+
## [0.5.1] - 2015-11-21
|
63
|
+
### Fixed
|
64
|
+
- remove puts statement
|
65
|
+
|
66
|
+
## [0.5.0] - 2015-11-21
|
67
|
+
### Added
|
68
|
+
- get latest category topics by page
|
69
|
+
|
70
|
+
## [0.4.0] - 2015-01-15
|
71
|
+
### Added
|
72
|
+
- generate an api key for a user
|
73
|
+
- revoke an api key for a user
|
74
|
+
- update user trust level
|
75
|
+
- grant user badge
|
76
|
+
|
77
|
+
## [0.3.6] - 2015-01-11
|
78
|
+
### Added
|
79
|
+
- list badges
|
80
|
+
- view email settings
|
81
|
+
- list emails sent
|
82
|
+
- list badges by user
|
83
|
+
- be able to specify SSL connection settings
|
84
|
+
- list api keys generated
|
85
|
+
- list backups created
|
86
|
+
|
87
|
+
## [0.3.5] - 2015-01-06
|
88
|
+
### Added
|
89
|
+
- Can now get a list of users by type: active, new, staff, etc.
|
90
|
+
- `client.category_latest_posts("category-slug")` endpoint
|
91
|
+
|
92
|
+
## [0.1.2] - 2014-05-11
|
93
|
+
|
94
|
+
- Release
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in discourse_api.gemspec
|
4
|
-
gemspec
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in discourse_api.gemspec
|
4
|
+
gemspec
|
data/Guardfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
guard :rspec do
|
2
|
-
watch(%r{^spec/.+_spec\.rb$})
|
3
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
4
|
-
watch('spec/spec_helper.rb') { "spec" }
|
5
|
-
end
|
1
|
+
guard :rspec do
|
2
|
+
watch(%r{^spec/.+_spec\.rb$})
|
3
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
4
|
+
watch('spec/spec_helper.rb') { "spec" }
|
5
|
+
end
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2014 Civilized Discourse Construction Kit, Inc.
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2014 Civilized Discourse Construction Kit, Inc.
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,73 +1,73 @@
|
|
1
|
-
# DiscourseApi
|
2
|
-
|
3
|
-
[![Code Climate](https://codeclimate.com/github/discourse/discourse_api.png)][codeclimate]
|
4
|
-
|
5
|
-
[codeclimate]: https://codeclimate.com/github/discourse/discourse_api
|
6
|
-
|
7
|
-
The Discourse API gem allows you to consume the Discourse API
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
Add this line to your application's Gemfile:
|
12
|
-
|
13
|
-
gem 'discourse_api'
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install discourse_api
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
Over time this project intends to have a full Discourse API. At the moment there are only a
|
26
|
-
few endpoints available:
|
27
|
-
|
28
|
-
```ruby
|
29
|
-
client = DiscourseApi::Client.new("http://try.discourse.org")
|
30
|
-
client.api_key = "YOUR_API_KEY"
|
31
|
-
client.api_username = "YOUR_USERNAME"
|
32
|
-
|
33
|
-
client.ssl(...) #=> specify SSL connection settings if needed
|
34
|
-
|
35
|
-
# Topic endpoints
|
36
|
-
client.latest_topics #=> Gets a list of the latest topics
|
37
|
-
client.hot_topics #=> Gets a list of hot topics
|
38
|
-
client.new_topics #=> Gets a list of new topics
|
39
|
-
client.topics_by("sam") #=> Gets a list of topics created by user "sam"
|
40
|
-
client.topic(57) #=> Gets the topic with id 57
|
41
|
-
|
42
|
-
# Search endpoint
|
43
|
-
client.search("sandbox") #=> Gets a list of topics that match "sandbox"
|
44
|
-
|
45
|
-
# Categories endpoint
|
46
|
-
client.categories #=> Gets a list of categories
|
47
|
-
client.category_latest_posts("category-slug") #=> Gets a list of latest posts in a category
|
48
|
-
|
49
|
-
# SSO endpoint
|
50
|
-
client.sync_sso( #=> Synchronizes the SSO record
|
51
|
-
sso_secret: "discourse_sso_rocks",
|
52
|
-
name: "Test Name",
|
53
|
-
username: "test_name",
|
54
|
-
email: "name@example.com",
|
55
|
-
external_id: "2"
|
56
|
-
)
|
57
|
-
```
|
58
|
-
|
59
|
-
|
60
|
-
## Contributing
|
61
|
-
|
62
|
-
1. Fork it
|
63
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
64
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
65
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
66
|
-
5. Create new Pull Request
|
67
|
-
|
68
|
-
## Testing
|
69
|
-
|
70
|
-
1. Install discourse locally
|
71
|
-
2. Inside of your discourse directory, run: `bundle exec rake db:api_test_seed`
|
72
|
-
3. Start discourse: `bundle exec rails s`
|
73
|
-
4. Inside of your discourse_api directory, run: `bundle exec rspec spec/`
|
1
|
+
# DiscourseApi
|
2
|
+
|
3
|
+
[![Code Climate](https://codeclimate.com/github/discourse/discourse_api.png)][codeclimate]
|
4
|
+
|
5
|
+
[codeclimate]: https://codeclimate.com/github/discourse/discourse_api
|
6
|
+
|
7
|
+
The Discourse API gem allows you to consume the Discourse API
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'discourse_api'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install discourse_api
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Over time this project intends to have a full Discourse API. At the moment there are only a
|
26
|
+
few endpoints available:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
client = DiscourseApi::Client.new("http://try.discourse.org")
|
30
|
+
client.api_key = "YOUR_API_KEY"
|
31
|
+
client.api_username = "YOUR_USERNAME"
|
32
|
+
|
33
|
+
client.ssl(...) #=> specify SSL connection settings if needed
|
34
|
+
|
35
|
+
# Topic endpoints
|
36
|
+
client.latest_topics #=> Gets a list of the latest topics
|
37
|
+
client.hot_topics #=> Gets a list of hot topics
|
38
|
+
client.new_topics #=> Gets a list of new topics
|
39
|
+
client.topics_by("sam") #=> Gets a list of topics created by user "sam"
|
40
|
+
client.topic(57) #=> Gets the topic with id 57
|
41
|
+
|
42
|
+
# Search endpoint
|
43
|
+
client.search("sandbox") #=> Gets a list of topics that match "sandbox"
|
44
|
+
|
45
|
+
# Categories endpoint
|
46
|
+
client.categories #=> Gets a list of categories
|
47
|
+
client.category_latest_posts("category-slug") #=> Gets a list of latest posts in a category
|
48
|
+
|
49
|
+
# SSO endpoint
|
50
|
+
client.sync_sso( #=> Synchronizes the SSO record
|
51
|
+
sso_secret: "discourse_sso_rocks",
|
52
|
+
name: "Test Name",
|
53
|
+
username: "test_name",
|
54
|
+
email: "name@example.com",
|
55
|
+
external_id: "2"
|
56
|
+
)
|
57
|
+
```
|
58
|
+
|
59
|
+
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
1. Fork it
|
63
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
64
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
65
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
66
|
+
5. Create new Pull Request
|
67
|
+
|
68
|
+
## Testing
|
69
|
+
|
70
|
+
1. Install discourse locally
|
71
|
+
2. Inside of your discourse directory, run: `bundle exec rake db:api_test_seed`
|
72
|
+
3. Start discourse: `bundle exec rails s`
|
73
|
+
4. Inside of your discourse_api directory, run: `bundle exec rspec spec/`
|