bearcat 0.9.1 → 0.9.2

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.
@@ -11,11 +11,13 @@ require 'bearcat/client/groups'
11
11
  require 'bearcat/client/conferences'
12
12
  require 'bearcat/client/users'
13
13
  require 'bearcat/client/reports'
14
+ require 'bearcat/client/accounts'
14
15
 
15
16
  module Bearcat
16
17
  class Client < Footrest::Client
17
18
 
18
19
  include Assignments
20
+ include Accounts
19
21
  include Courses
20
22
  include Enrollments
21
23
  include OutcomeGroups
@@ -34,4 +36,4 @@ module Bearcat
34
36
  end
35
37
  end
36
38
 
37
- end
39
+ end
@@ -0,0 +1,11 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module Accounts
4
+
5
+ def account(account)
6
+ get("/api/v1/accounts/#{account}")
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -12,4 +12,4 @@ module Bearcat
12
12
 
13
13
  end
14
14
  end
15
- end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '0.9.1' unless defined?(Bearcat::VERSION)
2
+ VERSION = '0.9.2' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -0,0 +1,15 @@
1
+ require 'helper'
2
+
3
+ describe Bearcat::Client::Accounts do
4
+ before do
5
+ @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
6
+ end
7
+
8
+ it "returns a single account" do
9
+ stub_get(@client, "/api/v1/accounts/1").to_return(json_response("single_account.json"))
10
+ account = @client.account(1)
11
+ account["id"].should == 1
12
+ account["name"].should == "Local Testing"
13
+ end
14
+
15
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "id":1,
3
+ "name":"Local Testing",
4
+ "parent_account_id":null,
5
+ "root_account_id":null,
6
+ "default_storage_quota_mb":500,
7
+ "default_user_storage_quota_mb":50,
8
+ "default_group_storage_quota_mb":50,
9
+ "default_time_zone":"America/Denver"
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: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -117,6 +117,7 @@ files:
117
117
  - Rakefile
118
118
  - bearcat.gemspec
119
119
  - lib/bearcat/api_array.rb
120
+ - lib/bearcat/client/accounts.rb
120
121
  - lib/bearcat/client/assignments.rb
121
122
  - lib/bearcat/client/conferences.rb
122
123
  - lib/bearcat/client/courses.rb
@@ -131,6 +132,7 @@ files:
131
132
  - lib/bearcat/client.rb
132
133
  - lib/bearcat/version.rb
133
134
  - lib/bearcat.rb
135
+ - spec/bearcat/client/accounts_spec.rb
134
136
  - spec/bearcat/client/assignments_spec.rb
135
137
  - spec/bearcat/client/conferences_spec.rb
136
138
  - spec/bearcat/client/courses_spec.rb
@@ -174,6 +176,7 @@ files:
174
176
  - spec/fixtures/report_status.json
175
177
  - spec/fixtures/section.json
176
178
  - spec/fixtures/section_enrollments.json
179
+ - spec/fixtures/single_account.json
177
180
  - spec/fixtures/start_report.json
178
181
  - spec/fixtures/update_outcome.json
179
182
  - spec/fixtures/update_outcome_group.json
@@ -206,6 +209,7 @@ signing_key:
206
209
  specification_version: 3
207
210
  summary: Canvas API
208
211
  test_files:
212
+ - spec/bearcat/client/accounts_spec.rb
209
213
  - spec/bearcat/client/assignments_spec.rb
210
214
  - spec/bearcat/client/conferences_spec.rb
211
215
  - spec/bearcat/client/courses_spec.rb
@@ -249,6 +253,7 @@ test_files:
249
253
  - spec/fixtures/report_status.json
250
254
  - spec/fixtures/section.json
251
255
  - spec/fixtures/section_enrollments.json
256
+ - spec/fixtures/single_account.json
252
257
  - spec/fixtures/start_report.json
253
258
  - spec/fixtures/update_outcome.json
254
259
  - spec/fixtures/update_outcome_group.json