megam_api 0.39 → 0.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/megam/api/accounts.rb +12 -12
- data/lib/megam/api/version.rb +1 -1
- data/test/test_accounts.rb +20 -2
- data/test/test_helper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd60098533007fe3a9b643d55cb878670e207d40
|
4
|
+
data.tar.gz: f0b88a82971c3bcb17c810fc327ba5133d0c26da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6ae07ffae5b01bc48efcb11ed50c737f9c0e2a5317fc3463eb162334c3424f85ff5351e363d8e0739cbd9dcfe8aebb570dc95a75b6c66d6255008d67d09238f
|
7
|
+
data.tar.gz: c31823b892d6ba4d46fd63ab7b1db6383a7cf65eb8ec9c09caa1c505da19675e6d2c491a8968909738d8006dfde628c0ed1fd03b586bad784dd9b82c5743295e
|
data/lib/megam/api/accounts.rb
CHANGED
@@ -24,20 +24,20 @@ module Megam
|
|
24
24
|
:method => :post,
|
25
25
|
:body => @options[:body]
|
26
26
|
)
|
27
|
-
|
27
|
+
end
|
28
28
|
|
29
|
-
|
30
|
-
# The body content needs to be a json.
|
31
|
-
def update_accounts(new_account)
|
29
|
+
def update_accounts(update_account)
|
32
30
|
@options = {:path => '/accounts/update',
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
31
|
+
:body => Megam::JSONCompat.to_json(update_account)}.merge(@options)
|
32
|
+
|
33
|
+
request(
|
34
|
+
:expects => 201,
|
35
|
+
:method => :post,
|
36
|
+
:body => @options[:body]
|
37
|
+
)
|
41
38
|
end
|
42
39
|
|
40
|
+
|
41
|
+
|
42
|
+
end
|
43
43
|
end
|
data/lib/megam/api/version.rb
CHANGED
data/test/test_accounts.rb
CHANGED
@@ -6,14 +6,14 @@ class TestAccounts < MiniTest::Unit::TestCase
|
|
6
6
|
$normal = "normal-tom"
|
7
7
|
$tom_email = "tom@gomegam.com"
|
8
8
|
$bob_email = "bob@gomegam.com"
|
9
|
-
|
9
|
+
=begin
|
10
10
|
def test_get_accounts_good
|
11
11
|
response =megams.get_accounts(sandbox_email)
|
12
12
|
response.body.to_s
|
13
13
|
assert_equal(200, response.status)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
16
|
+
def test_post_accounts_good
|
17
17
|
tmp_hash = {
|
18
18
|
"id" => "000099090909000",
|
19
19
|
"first_name" => "Darth",
|
@@ -30,6 +30,24 @@ class TestAccounts < MiniTest::Unit::TestCase
|
|
30
30
|
response.body.to_s
|
31
31
|
assert_equal(201, response.status)
|
32
32
|
end
|
33
|
+
=end
|
34
|
+
def test_update_accounts_good
|
35
|
+
tmp_hash = {
|
36
|
+
"id" => "w3423",
|
37
|
+
"first_name" => "Darth",
|
38
|
+
"last_name" => "Vader",
|
39
|
+
"email" => "super@test.com",
|
40
|
+
"phone" => "19090909090011111111",
|
41
|
+
"api_key" => "IamAtlas{74}NobdyCanSedfefdeME#07",
|
42
|
+
"password" => "tset",
|
43
|
+
"authority" => "admin",
|
44
|
+
"password_reset_key" => "",
|
45
|
+
"created_at" => "2014-10-29 13:24:06 +0000"
|
46
|
+
}
|
47
|
+
response = megams.update_accounts(tmp_hash)
|
48
|
+
response.body.to_s
|
49
|
+
assert_equal(201, response.status)
|
50
|
+
end
|
33
51
|
|
34
52
|
=begin
|
35
53
|
def test_get_accounts_bad
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: megam_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.40'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|