edmodo-api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/README.markdown +1 -1
- data/lib/edmodo-api/client.rb +1 -1
- data/lib/edmodo-api/version.rb +1 -1
- data/spec/edmodo-api_spec.rb +8 -0
- data/spec/spec_helper.rb +26 -0
- metadata +2 -1
data/.travis.yml
ADDED
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Edmodo::API - Edmodo Ruby API client
|
1
|
+
Edmodo::API - Edmodo Ruby API client [![Build Status](https://secure.travis-ci.org/gabceb/edmodo-api.png)](http://travis-ci.org/gabceb/edmodo-api) [![Dependency Status](https://gemnasium.com/gabceb/edmodo-api.png)](https://gemnasium.com/gabceb/edmodo-api)
|
2
2
|
=======
|
3
3
|
|
4
4
|
A Ruby wrapper for the Edmodo REST API.
|
data/lib/edmodo-api/client.rb
CHANGED
data/lib/edmodo-api/version.rb
CHANGED
data/spec/edmodo-api_spec.rb
CHANGED
@@ -86,6 +86,14 @@ describe Edmodo::API::Client do
|
|
86
86
|
response.should == [{"user_type"=>"TEACHER", "user_token"=>"b020c42d1", "first_name"=>"Bob", "last_name"=>"Smith", "avatar_url"=>"http://edmodoimages.s3.amazonaws.com/default_avatar.png", "thumb_url"=>"http://edmodoimages.s3.amazonaws.com/default_avatar_t.png"}, {"user_type"=>"STUDENT", "user_token"=>"jd3i1c0pl", "first_name"=>"Jane", "last_name"=>"Student", "avatar_url"=>"http://edmodoimages.s3.amazonaws.com/default_avatar.png", "thumb_url"=>"http://edmodoimages.s3.amazonaws.com/default_avatar_t.png"}]
|
87
87
|
end
|
88
88
|
|
89
|
+
it 'should get the correct hash back from the groups request' do
|
90
|
+
|
91
|
+
groups_id = [379557,379562]
|
92
|
+
response = @client.groups(groups_id)
|
93
|
+
|
94
|
+
response.should == [{"group_id"=>379557, "title"=>"Algebra", "member_count"=>20, "owners"=>["b020c42d1", "693d5c765"], "start_level"=>"9th", "end_level"=>"9th"}, {"group_id"=>379562, "title"=>"Geometry", "member_count"=>28, "owners"=>["b020c42d1"], "start_level"=>"3rd", "end_level"=>"3rd"}]
|
95
|
+
end
|
96
|
+
|
89
97
|
it 'should throw an exception if the method is not yet implemented' do
|
90
98
|
user_id = "b020c42d1"
|
91
99
|
|
data/spec/spec_helper.rb
CHANGED
@@ -80,6 +80,32 @@ FakeWeb.register_uri(:get, uri,
|
|
80
80
|
}
|
81
81
|
]')
|
82
82
|
|
83
|
+
uri = "#{Edmodo::API::Config.endpoints[:sandbox]}/groups.json?api_key=#{@api_key}&group_ids=%5B379557%2C379562%5D"
|
84
|
+
|
85
|
+
FakeWeb.register_uri(:get, uri,
|
86
|
+
:body => '[{
|
87
|
+
"group_id":379557,
|
88
|
+
"title":"Algebra",
|
89
|
+
"member_count":20,
|
90
|
+
"owners":[
|
91
|
+
"b020c42d1",
|
92
|
+
"693d5c765"
|
93
|
+
],
|
94
|
+
"start_level":"9th",
|
95
|
+
"end_level":"9th"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"group_id":379562,
|
99
|
+
"title":"Geometry",
|
100
|
+
"member_count":28,
|
101
|
+
"owners":[
|
102
|
+
"b020c42d1"
|
103
|
+
],
|
104
|
+
"start_level":"3rd",
|
105
|
+
"end_level":"3rd"
|
106
|
+
}
|
107
|
+
]')
|
108
|
+
|
83
109
|
# RegisterBadge request uri
|
84
110
|
uri = "#{Edmodo::API::Config.endpoints[:sandbox]}/registerBadge?api_key=#{@api_key}&badge_title=Good%20Job&description=You%20did%20a%20good%20job&image_url=http%3A%2F%2Fwww.edmodo.com%2Fbadge_image.png"
|
85
111
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edmodo-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -115,6 +115,7 @@ extensions: []
|
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
117
|
- .gitignore
|
118
|
+
- .travis.yml
|
118
119
|
- Gemfile
|
119
120
|
- Gemfile.lock
|
120
121
|
- MIT-LICENSE
|