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 ADDED
@@ -0,0 +1,3 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
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.
@@ -59,7 +59,7 @@ module Edmodo
59
59
  #
60
60
  # => group_ids: array of group ids
61
61
  def groups group_ids
62
- group_ids = Arary(group_ids)
62
+ group_ids = Array(group_ids)
63
63
 
64
64
  request :get, resource_uri("groups", @format), {:group_ids => group_ids.to_json}
65
65
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Edmodo
4
4
  module API
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
7
  end
@@ -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.1
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