desmos 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/desmos.gemspec +2 -2
- data/lib/desmos/whiteboard.rb +4 -4
- data/spec/desmos/whiteboard_spec.rb +6 -5
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/desmos.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{desmos}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Ryan Moran}]
|
12
|
-
s.date = %q{2011-09-
|
12
|
+
s.date = %q{2011-09-13}
|
13
13
|
s.description = %q{Desmos API Wrapper}
|
14
14
|
s.email = %q{ryan.moran@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/desmos/whiteboard.rb
CHANGED
@@ -35,14 +35,14 @@ module Desmos
|
|
35
35
|
else
|
36
36
|
self.hash = parsed_response.fetch(:hash)
|
37
37
|
end
|
38
|
-
|
38
|
+
set_tutor
|
39
39
|
add_students
|
40
40
|
self
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
43
|
+
def set_tutor
|
44
44
|
if tutor
|
45
|
-
parsed_response = request!(:whiteboard, :
|
45
|
+
parsed_response = request!(:whiteboard, :set_tutor, tutor.request_options.reject { |k,v| k == :user_type }.merge(:whiteboard_hash => hash))
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -55,7 +55,7 @@ module Desmos
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def add_student(student)
|
58
|
-
parsed_response = request!(:whiteboard, :
|
58
|
+
parsed_response = request!(:whiteboard, :add_student, student.request_options.reject { |k,v| k == :user_type }.merge(:whiteboard_hash => hash))
|
59
59
|
end
|
60
60
|
|
61
61
|
def get
|
@@ -55,7 +55,10 @@ describe Desmos::Whiteboard, '#save' do
|
|
55
55
|
stub_request(:get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/create/).
|
56
56
|
to_return(:status => 200, :body => "{\"success\": \"true\", \"hash\": \"abcde\"}")
|
57
57
|
|
58
|
-
stub_request(:get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/
|
58
|
+
stub_request(:get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/set_tutor/).
|
59
|
+
to_return(:status => 200, :body => "{\"success\": \"true\", \"hash\": \"abcde\"}")
|
60
|
+
|
61
|
+
stub_request(:get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/add_student/).
|
59
62
|
to_return(:status => 200, :body => "{\"success\": \"true\", \"hash\": \"abcde\"}")
|
60
63
|
end
|
61
64
|
|
@@ -67,7 +70,8 @@ describe Desmos::Whiteboard, '#save' do
|
|
67
70
|
whiteboard.save
|
68
71
|
|
69
72
|
assert_requested :get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/create/, :times => 1
|
70
|
-
assert_requested :get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/
|
73
|
+
assert_requested :get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/set_tutor/, :times => 1
|
74
|
+
assert_requested :get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/add_student/, :times => 1
|
71
75
|
end
|
72
76
|
|
73
77
|
end
|
@@ -78,9 +82,6 @@ describe Desmos::Whiteboard, '#save' do
|
|
78
82
|
stub_request(:get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/create/).
|
79
83
|
to_return(:status => 200, :body => "{\"success\": \"true\", \"hash\": \"abcde\"}").
|
80
84
|
to_return(:status => 200, :body => "{\"success\":\"false\",\"error_code\":1,\"error_message\":\"whiteboard already exists\"}")
|
81
|
-
|
82
|
-
stub_request(:get, /https\:\/\/api\.tutortrove\.com\/api_v1\/whiteboard\/add_user/).
|
83
|
-
to_return(:status => 200, :body => "{\"success\": \"true\", \"hash\": \"abcde\"}")
|
84
85
|
end
|
85
86
|
|
86
87
|
it 'calls out to the Desmos API to save the whiteboard, tutor, and students' do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: desmos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Moran
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-13 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|