math-api 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. data/lib/math-api.rb +5 -2
  2. data/spec/mathapi_spec.rb +1 -1
  3. metadata +1 -1
data/lib/math-api.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  require 'httparty'
2
+ require 'pp'
2
3
 
3
4
  module Math
4
5
  class API
5
6
 
6
- VERSION = "0.0.2"
7
+ VERSION = "0.0.3"
7
8
 
8
9
  include HTTParty
9
10
  format :json
@@ -23,9 +24,11 @@ module Math
23
24
 
24
25
 
25
26
  def authenticate
26
- resp = self.class.get('/api/1/users/profile.json', { accesskey: @accesskey })
27
+
28
+ resp = self.class.get('/api/1/users/profile.json', query: { accesskey: @accesskey })
27
29
 
28
30
  raise Error.new("Unauthorized") unless resp.code == 200
31
+
29
32
  end
30
33
 
31
34
 
data/spec/mathapi_spec.rb CHANGED
@@ -26,7 +26,7 @@ describe Math::API do
26
26
  before(:all) do
27
27
  FakeWeb.clean_registry
28
28
 
29
- FakeWeb.register_uri(:get, "#{API_ROOT}/api/1/users/profile.json", :status => ["200"])
29
+ FakeWeb.register_uri(:get, "#{API_ROOT}/api/1/users/profile.json?accesskey=#{ACCESSKEY}", :status => ["200"])
30
30
  FakeWeb.register_uri(:post, "#{API_ROOT}/api/1/users/#{USER_ID}/records.json", :status => ["201"])
31
31
 
32
32
  @api = Math::API.new( accesskey: ACCESSKEY, user_id: USER_ID, math_url: API_ROOT )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: math-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: