bearcat 1.2.18 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bearcat/client/o_auth2.rb +6 -3
- data/lib/bearcat/client/quizzes.rb +4 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/quizzes_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c062a25b931154ce8a21c595eb2b1a567214c672
|
4
|
+
data.tar.gz: 2a03cc537a145e49b6bf5f0faaa5422538bdfce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69c08cbbb6c65bdafd273c167f2227884a38fe598a9fef6a1dcd447ac64803850660f4cbe0666e6b20cf5123c7b003d642df212816e85dc9bf95c548f44ea533
|
7
|
+
data.tar.gz: 964fb6b75ae013c1ce0bc61999f5304ffff3c6717cd12011b68b0ddc09365886c5a483efd6638a2b4532184194009f3b8058103194adf74f58d3bf25602b136f
|
@@ -2,15 +2,18 @@ module Bearcat
|
|
2
2
|
class Client < Footrest::Client
|
3
3
|
module OAuth2
|
4
4
|
|
5
|
-
def auth_redirect_url(client_id, redirect_uri,
|
5
|
+
def auth_redirect_url(client_id, redirect_uri, opts = {})
|
6
|
+
opts[:response_type] ||= 'code'
|
7
|
+
|
6
8
|
fullpath('login/oauth2/auth')
|
7
9
|
uri = URI.parse(fullpath('login/oauth2/auth'))
|
8
10
|
query = [
|
9
11
|
['client_id', client_id],
|
10
12
|
['redirect_uri', redirect_uri],
|
11
|
-
['response_type', response_type]
|
13
|
+
['response_type', opts[:response_type]]
|
12
14
|
]
|
13
|
-
query << ['
|
15
|
+
query << ['state', opts[:state]] if opts[:state]
|
16
|
+
query << ['scopes', opts[:scope]] if opts[:scope]
|
14
17
|
uri.query = URI.encode_www_form(query)
|
15
18
|
uri.to_s
|
16
19
|
end
|
@@ -10,6 +10,10 @@ module Bearcat
|
|
10
10
|
get("/api/v1/courses/#{course}/quizzes/#{quiz}", params)
|
11
11
|
end
|
12
12
|
|
13
|
+
def edit_quiz(course, quiz, params={})
|
14
|
+
put("/api/v1/courses/#{course}/quizzes/#{quiz}", params)
|
15
|
+
end
|
16
|
+
|
13
17
|
def quiz_extensions(course, quiz, params={})
|
14
18
|
post("/api/v1/courses/#{course}/quizzes/#{quiz}/extensions", params)
|
15
19
|
end
|
data/lib/bearcat/version.rb
CHANGED
@@ -5,6 +5,13 @@ describe Bearcat::Client::Quizzes do
|
|
5
5
|
@client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
|
6
6
|
end
|
7
7
|
|
8
|
+
it "updates a single quiz" do
|
9
|
+
stub_put(@client, "/api/v1/courses/1/quizzes/38").to_return(json_response("quizzes/course_quiz.json"))
|
10
|
+
course_quiz = @client.edit_quiz('1', '38')
|
11
|
+
course_quiz.class.should eq(Hash)
|
12
|
+
course_quiz['id'].should == 38
|
13
|
+
end
|
14
|
+
|
8
15
|
it "returns a courses quizzes" do
|
9
16
|
stub_get(@client, "/api/v1/courses/1/quizzes").to_return(json_response("quizzes/course_quizzes.json"))
|
10
17
|
course_quizzes = @client.list_course_quizzes('1')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills, Jake Sorce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|