bearcat 1.2.18 → 1.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1576ece83267a9212a00c6fc0a058e5e4ee1a91
4
- data.tar.gz: d0b06c5fcb109b1e376c886e54cdccd040ee3eba
3
+ metadata.gz: c062a25b931154ce8a21c595eb2b1a567214c672
4
+ data.tar.gz: 2a03cc537a145e49b6bf5f0faaa5422538bdfce5
5
5
  SHA512:
6
- metadata.gz: c8a21cc34b9f32f669416ff4bd3e58680c31972aaf61cd7e4c171d0579c65f11455c27149d37705969e3f6f07bffcb7689d4c781f42c43b47edea9f6068d38ee
7
- data.tar.gz: e8ddebc8984761cac508c28755c0593655bab12e222a95ef09673c1b03ab6045a59257ccccb20cf3c0bc366880c4cfb53998ba2317545fb4e2c4cd16b1c974a1
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, scopes = nil, response_type='code')
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 << ['scopes', scopes] if scopes
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
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.2.18' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.3.1' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -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.2.18
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-12 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake