bearcat 1.0.3 → 1.0.4

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: 091f832ac71d9fae4f55ee7826ba6e841ba8d5a6
4
- data.tar.gz: 21f33e25f39455eb1e992ee0f76cf3f3d4697f8e
3
+ metadata.gz: e34db19e81f12e7a327ce9d2b49740144fcdac13
4
+ data.tar.gz: 6d3b1e4a5e0b1b15594c865351a6733d714f7d46
5
5
  SHA512:
6
- metadata.gz: 073d68053af3a70c7514494bb3ec83631ffc4b7489f07c8dabde4f199aea84ac610fa389740778f6ca946c2edc271dd09e3e99d13abbcdd48deec6c6f66325ba
7
- data.tar.gz: bbfb77ac851b2161eb0adfa39419e764c5d9eddf754291d75c8df9b6a1bd2e7adadb8447d0a61d6d03d82fc742e90b008d14db42ba70df7debe4b46c28f89304
6
+ metadata.gz: f78d75cb2d1874f508a58229cba1f19cbf3bae4eab4f009182cdb7aabab999fff8fdc82cac745357798cff95fc9e5e0f9222547c1ed918f71b7e5e41d7df90ff
7
+ data.tar.gz: d3765ca4dd0d822767ed9289c391c40342809c746f2320c864c6708db5320de90a7bd23205a1f5a0fc0163bbddc5a2f09c4288f21bd623fab9b0ab2715f8a788
@@ -21,6 +21,7 @@ module Bearcat
21
21
  require 'bearcat/client/canvas_files'
22
22
  require 'bearcat/client/calendar_events'
23
23
  require 'bearcat/client/discussions'
24
+ require 'bearcat/client/search'
24
25
  require 'bearcat/client/quizzes'
25
26
 
26
27
  include Assignments
@@ -42,6 +43,7 @@ module Bearcat
42
43
  include CalendarEvents
43
44
  include Discussions
44
45
  include FileHelper
46
+ include Search
45
47
  include Quizzes
46
48
 
47
49
 
@@ -0,0 +1,11 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module Search
4
+
5
+ def find_recipients(params={})
6
+ get('/api/v1/conversations/find_recipients', params)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.0.3' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.0.4' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -14,9 +14,11 @@ describe Bearcat::Client::Accounts do
14
14
 
15
15
  it "returns enrollment terms for an account" do
16
16
  stub_get(@client, "/api/v1/accounts/1/terms").to_return(json_response("enrollment_terms.json"))
17
- terms = @client.terms(1).first
18
- terms['id'].should == 4
19
- terms['name'].should == 'Term 1'
17
+ account = @client.terms(1)
18
+ terms = account.members
19
+ terms.count.should == 1
20
+ terms.first['id'].should == 4
21
+ terms.first['name'].should == 'Term 1'
20
22
  end
21
23
 
22
24
  end
@@ -0,0 +1,16 @@
1
+ require 'helper'
2
+
3
+ describe Bearcat::Client::Search do
4
+ before do
5
+ @client = Bearcat::Client.new(prefix:"http://canvas.instructure.com", token: "test_token")
6
+ end
7
+
8
+ it "returns search results for recipients" do
9
+ stub_get(@client, "/api/v1/conversations/find_recipients?search=test").to_return(json_response("search_find_recipients.json"))
10
+ results = @client.find_recipients(:search => 'test')
11
+ results.first['name'].should == 'Test'
12
+ results.first['id'].should == 9
13
+ end
14
+
15
+
16
+ end
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "id": 9,
4
+ "name": "Test",
5
+ "avatar_url": "http://localhost:3000/images/messages/avatar-group-50.png",
6
+ "type": "context",
7
+ "user_count": 5,
8
+ "permissions": {}
9
+ }
10
+ ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bearcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Mills, Jake Sorce
@@ -122,6 +122,7 @@ files:
122
122
  - lib/bearcat/client/outcomes.rb
123
123
  - lib/bearcat/client/quizzes.rb
124
124
  - lib/bearcat/client/reports.rb
125
+ - lib/bearcat/client/search.rb
125
126
  - lib/bearcat/client/sections.rb
126
127
  - lib/bearcat/client/submissions.rb
127
128
  - lib/bearcat/client/users.rb
@@ -144,6 +145,7 @@ files:
144
145
  - spec/bearcat/client/outcomes_spec.rb
145
146
  - spec/bearcat/client/quizzes_spec.rb
146
147
  - spec/bearcat/client/reports_spec.rb
148
+ - spec/bearcat/client/search_spec.rb
147
149
  - spec/bearcat/client/sections_spec.rb
148
150
  - spec/bearcat/client/submissions_spec.rb
149
151
  - spec/bearcat/client/users_spec.rb
@@ -204,6 +206,7 @@ files:
204
206
  - spec/fixtures/report_history.json
205
207
  - spec/fixtures/report_list.json
206
208
  - spec/fixtures/report_status.json
209
+ - spec/fixtures/search_find_recipients.json
207
210
  - spec/fixtures/section.json
208
211
  - spec/fixtures/section_enrollments.json
209
212
  - spec/fixtures/single_account.json
@@ -258,6 +261,7 @@ test_files:
258
261
  - spec/bearcat/client/outcomes_spec.rb
259
262
  - spec/bearcat/client/quizzes_spec.rb
260
263
  - spec/bearcat/client/reports_spec.rb
264
+ - spec/bearcat/client/search_spec.rb
261
265
  - spec/bearcat/client/sections_spec.rb
262
266
  - spec/bearcat/client/submissions_spec.rb
263
267
  - spec/bearcat/client/users_spec.rb
@@ -318,6 +322,7 @@ test_files:
318
322
  - spec/fixtures/report_history.json
319
323
  - spec/fixtures/report_list.json
320
324
  - spec/fixtures/report_status.json
325
+ - spec/fixtures/search_find_recipients.json
321
326
  - spec/fixtures/section.json
322
327
  - spec/fixtures/section_enrollments.json
323
328
  - spec/fixtures/single_account.json