canvas_oauth_engine 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas_oauth/canvas_api.rb +1 -1
- data/lib/canvas_oauth/version.rb +1 -1
- data/spec/dummy/db/migrate/{20130326194409_create_canvas_oauth_authorizations.canvas_oauth.rb → 20160711200737_create_canvas_oauth_authorizations.canvas_oauth.rb} +3 -0
- data/spec/dummy/db/schema.rb +9 -7
- data/spec/lib/canvas_oauth/canvas_api_spec.rb +20 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2678d6d70df8098c96fc980993d1101b531da101
|
4
|
+
data.tar.gz: 053b76ff287adf0d75cbd384f0187cf1ae87166f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e65e0f1baaff06bd0c1c31dcb22cc53bb406904a751f2b4812d8945a370b5cad979fdfd2731749c6e0e9dfc0e8ec66e687a69980685ce80080b46662991db2c
|
7
|
+
data.tar.gz: 8aef10c7d01cbabf450da980031797fabc40ecdb009d1bfa6cdea57fa9d38d408c8107c67112a3de20d0687800bf26b9d731a03a53ce9278be7e56dae3129f61
|
data/lib/canvas_oauth/version.rb
CHANGED
@@ -9,5 +9,8 @@ class CreateCanvasOauthAuthorizations < ActiveRecord::Migration
|
|
9
9
|
t.datetime "created_at", :null => false
|
10
10
|
t.datetime "updated_at", :null => false
|
11
11
|
end
|
12
|
+
|
13
|
+
add_index :canvas_oauth_authorizations, [:canvas_user_id, :tool_consumer_instance_guid],
|
14
|
+
name: 'index_canvas_oauth_auths_on_user_id_and_tciguid'
|
12
15
|
end
|
13
16
|
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -9,17 +9,19 @@
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
11
|
#
|
12
|
-
# It's strongly recommended
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:
|
14
|
+
ActiveRecord::Schema.define(version: 20121121005358) do
|
15
15
|
|
16
|
-
create_table "canvas_oauth_authorizations", :
|
17
|
-
t.integer "canvas_user_id", :
|
18
|
-
t.string "tool_consumer_instance_guid",
|
16
|
+
create_table "canvas_oauth_authorizations", force: true do |t|
|
17
|
+
t.integer "canvas_user_id", limit: 8
|
18
|
+
t.string "tool_consumer_instance_guid", null: false
|
19
19
|
t.string "token"
|
20
20
|
t.datetime "last_used_at"
|
21
|
-
t.datetime "created_at",
|
22
|
-
t.datetime "updated_at",
|
21
|
+
t.datetime "created_at", null: false
|
22
|
+
t.datetime "updated_at", null: false
|
23
23
|
end
|
24
24
|
|
25
|
+
add_index "canvas_oauth_authorizations", ["canvas_user_id", "tool_consumer_instance_guid"], name: "index_canvas_oauth_auths_on_user_id_and_tciguid"
|
26
|
+
|
25
27
|
end
|
@@ -18,6 +18,26 @@ describe CanvasOauth::CanvasApi do
|
|
18
18
|
it { is_expected.to eq "http://test.canvas/login/oauth2/auth?client_id=key&response_type=code&state=zzxxyy&redirect_uri=http://localhost:3001/canvas/oauth" }
|
19
19
|
end
|
20
20
|
|
21
|
+
describe "hash_csv" do
|
22
|
+
it "accepts a csv string and hashes it" do
|
23
|
+
csv = "canvas_course_id,course_id,short_name\n1,,Test Course"
|
24
|
+
expect(canvas.hash_csv(csv)).to eq([{
|
25
|
+
"canvas_course_id" => "1",
|
26
|
+
"course_id" => "",
|
27
|
+
"short_name" => "Test Course"
|
28
|
+
}])
|
29
|
+
end
|
30
|
+
|
31
|
+
it "accepts a parsed csv array and hashes it" do
|
32
|
+
csv = [["canvas_course_id", "course_id", "short_name"], ["1", nil, "Test Course"]]
|
33
|
+
expect(canvas.hash_csv(csv)).to eq([{
|
34
|
+
"canvas_course_id" => "1",
|
35
|
+
"course_id" => "",
|
36
|
+
"short_name" => "Test Course"
|
37
|
+
}])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
21
41
|
describe "get_access_token" do
|
22
42
|
it "POSTs to /login/oauth2/token" do
|
23
43
|
expect(CanvasOauth::CanvasApi).to receive(:post).with('/login/oauth2/token', anything()).and_return({})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_oauth_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Donahue
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -248,7 +248,7 @@ files:
|
|
248
248
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
249
249
|
- spec/dummy/config/locales/en.yml
|
250
250
|
- spec/dummy/config/routes.rb
|
251
|
-
- spec/dummy/db/migrate/
|
251
|
+
- spec/dummy/db/migrate/20160711200737_create_canvas_oauth_authorizations.canvas_oauth.rb
|
252
252
|
- spec/dummy/db/schema.rb
|
253
253
|
- spec/dummy/db/test.sqlite3
|
254
254
|
- spec/dummy/log/test.log
|
@@ -307,7 +307,7 @@ test_files:
|
|
307
307
|
- spec/dummy/config/locales/en.yml
|
308
308
|
- spec/dummy/config/routes.rb
|
309
309
|
- spec/dummy/config.ru
|
310
|
-
- spec/dummy/db/migrate/
|
310
|
+
- spec/dummy/db/migrate/20160711200737_create_canvas_oauth_authorizations.canvas_oauth.rb
|
311
311
|
- spec/dummy/db/schema.rb
|
312
312
|
- spec/dummy/db/test.sqlite3
|
313
313
|
- spec/dummy/log/test.log
|