vkontakte 0.0.6 → 0.0.7
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.
- checksums.yaml +4 -4
- data/lib/vkontakte/api/base.rb +1 -1
- data/lib/vkontakte/version.rb +1 -1
- data/spec/api/friends_spec.rb +5 -5
- data/spec/api/groups_spec.rb +7 -8
- data/spec/api/likes_spec.rb +1 -2
- data/spec/api/photos_spec.rb +2 -2
- data/spec/api/profile_spec.rb +3 -3
- data/spec/api/secure_spec.rb +1 -2
- data/spec/api/wall_spec.rb +1 -1
- data/spec/apps/user_spec.rb +1 -1
- 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: 1e3de3382229146088df24343d8b3fa1265ca517
|
|
4
|
+
data.tar.gz: 038f82fd22199980321a028a18747f54b4f4a415
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bbf6ee89ca55f20624166568caa121a5f726cc86412339f76e84492f5431efb4605dcece99dd5648d4733fb87f141ecd3d670af02c56cdd5a88d8bebb7a7827
|
|
7
|
+
data.tar.gz: 2d85a4718718bb739b4eafdfd30901870ed7673d8eba0921999eec2b231964aa1328c19c4442f0696824007ac2268c211aaf3cf98ff619c3b937f40f4f60e3b8
|
data/lib/vkontakte/api/base.rb
CHANGED
data/lib/vkontakte/version.rb
CHANGED
data/spec/api/friends_spec.rb
CHANGED
|
@@ -15,7 +15,7 @@ describe Vkontakte::Api::Friends do
|
|
|
15
15
|
|
|
16
16
|
it "should get friends list by uid param" do
|
|
17
17
|
FakeWeb.register_uri(:get,
|
|
18
|
-
"https://api.vk.com/method/friends.get?access_token=#{@token}&uid=81202312",
|
|
18
|
+
"https://api.vk.com/method/friends.get?v=5.24&access_token=#{@token}&uid=81202312",
|
|
19
19
|
:body => '{"response":[2592709,3859793,4663468]}')
|
|
20
20
|
|
|
21
21
|
@iframe.friends.get(:uid => 81202312).should == [2592709, 3859793, 4663468]
|
|
@@ -23,7 +23,7 @@ describe Vkontakte::Api::Friends do
|
|
|
23
23
|
|
|
24
24
|
it "should get friends list by fields" do
|
|
25
25
|
FakeWeb.register_uri(:get,
|
|
26
|
-
"https://api.vk.com/method/friends.get?access_token=#{@token}&fields=81202312",
|
|
26
|
+
"https://api.vk.com/method/friends.get?v=5.24&access_token=#{@token}&fields=81202312",
|
|
27
27
|
:body => '{"response":[{"uid":2592709,"first_name":"Павел","last_name":"Галета","online":0},{"uid":3859793,"first_name":"Мария","last_name":"Семёнова","online":0},{"uid":4663468,"first_name":"Ekaterina","last_name":"Koronotova","online":0}]}')
|
|
28
28
|
|
|
29
29
|
@iframe.friends.get(:fields => 81202312).should == [{"uid"=>2592709, "last_name"=>"\320\223\320\260\320\273\320\265\321\202\320\260", "online"=>0, "first_name"=>"\320\237\320\260\320\262\320\265\320\273"}, {"uid"=>3859793, "last_name"=>"\320\241\320\265\320\274\321\221\320\275\320\276\320\262\320\260", "online"=>0, "first_name"=>"\320\234\320\260\321\200\320\270\321\217"}, {"uid"=>4663468, "last_name"=>"Koronotova", "online"=>0, "first_name"=>"Ekaterina"}]
|
|
@@ -31,7 +31,7 @@ describe Vkontakte::Api::Friends do
|
|
|
31
31
|
|
|
32
32
|
it "should get getAppUsers" do
|
|
33
33
|
FakeWeb.register_uri(:get,
|
|
34
|
-
"https://api.vk.com/method/friends.getAppUsers?access_token=#{@token}",
|
|
34
|
+
"https://api.vk.com/method/friends.getAppUsers?v=5.24&access_token=#{@token}",
|
|
35
35
|
:body => '{"response":[2592709]}')
|
|
36
36
|
|
|
37
37
|
@iframe.friends.getAppUsers.should == [2592709]
|
|
@@ -39,7 +39,7 @@ describe Vkontakte::Api::Friends do
|
|
|
39
39
|
|
|
40
40
|
it "should get getOnline" do
|
|
41
41
|
FakeWeb.register_uri(:get,
|
|
42
|
-
"https://api.vk.com/method/friends.getOnline?access_token=#{@token}&uid=2592709",
|
|
42
|
+
"https://api.vk.com/method/friends.getOnline?v=5.24&access_token=#{@token}&uid=2592709",
|
|
43
43
|
:body => '{"response":[2450999,2488708,2649518,4440077]}')
|
|
44
44
|
|
|
45
45
|
@iframe.friends.getOnline(:uid => 2592709).should == [2450999, 2488708, 2649518, 4440077]
|
|
@@ -47,7 +47,7 @@ describe Vkontakte::Api::Friends do
|
|
|
47
47
|
|
|
48
48
|
it "should get getMutual" do
|
|
49
49
|
FakeWeb.register_uri(:get,
|
|
50
|
-
"https://api.vk.com/method/friends.getMutual?target_uid=2450999&access_token=#{@token}&source_uid=2592709",
|
|
50
|
+
"https://api.vk.com/method/friends.getMutual?v=5.24&target_uid=2450999&access_token=#{@token}&source_uid=2592709",
|
|
51
51
|
:body => '{"response":[2301578,2619312,5818827,6391852,6411298,6422462]}')
|
|
52
52
|
|
|
53
53
|
response = @iframe.friends.getMutual(:target_uid => 2450999, :source_uid => 2592709)
|
data/spec/api/groups_spec.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
require "spec_helper"
|
|
3
2
|
|
|
4
3
|
describe Vkontakte::Api::Groups do
|
|
@@ -15,7 +14,7 @@ describe Vkontakte::Api::Groups do
|
|
|
15
14
|
|
|
16
15
|
it "should get groups list by uid param" do
|
|
17
16
|
FakeWeb.register_uri(:get,
|
|
18
|
-
"https://api.vk.com/method/groups.get?access_token=#{@token}&uid=81202312",
|
|
17
|
+
"https://api.vk.com/method/groups.get?v=5.24&access_token=#{@token}&uid=81202312",
|
|
19
18
|
:body => '{"response":[16527885]}')
|
|
20
19
|
|
|
21
20
|
@iframe.groups.get(:uid => 81202312).should == [16527885]
|
|
@@ -23,7 +22,7 @@ describe Vkontakte::Api::Groups do
|
|
|
23
22
|
|
|
24
23
|
it "should raise permission error on access friend groups" do
|
|
25
24
|
FakeWeb.register_uri(:get,
|
|
26
|
-
"https://api.vk.com/method/groups.get?access_token=#{@token}&uid=2592709",
|
|
25
|
+
"https://api.vk.com/method/groups.get?v=5.24&access_token=#{@token}&uid=2592709",
|
|
27
26
|
:body => '{"error":{"error_code":7,"error_msg":"Permission to perform this action is denied by user","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"groups.get"},{"key":"uid","value":"2592709"},{"key":"access_token","value":"74aee6063ec4aea07047ba3cb47079607f870797079ea90fef75c6361570a5f"}]}}')
|
|
28
27
|
|
|
29
28
|
lambda {
|
|
@@ -38,7 +37,7 @@ describe Vkontakte::Api::Groups do
|
|
|
38
37
|
|
|
39
38
|
it "should return group info" do
|
|
40
39
|
FakeWeb.register_uri(:get,
|
|
41
|
-
"https://api.vk.com/method/groups.getById?access_token=#{@token}&gid=#{@group_id}",
|
|
40
|
+
"https://api.vk.com/method/groups.getById?v=5.24&access_token=#{@token}&gid=#{@group_id}",
|
|
42
41
|
:body => '{"response":[{"gid":16527885,"name":"Club Music Group of Kiev","screen_name":"club16527885","is_closed":0,"type":"group","photo":"http:\/\/cs884.vkontakte.ru\/g16527885\/c_08b73308.jpg","photo_medium":"http:\/\/cs884.vkontakte.ru\/g16527885\/b_6e68053d.jpg","photo_big":"http:\/\/cs884.vkontakte.ru\/g16527885\/a_ba67625c.jpg"}]}')
|
|
43
42
|
|
|
44
43
|
@iframe.groups.getById(:gid => @group_id).should == [{"photo"=>"http://cs884.vkontakte.ru/g16527885/c_08b73308.jpg", "name"=>"Club Music Group of Kiev", "gid"=>16527885, "is_closed"=>0, "photo_medium"=>"http://cs884.vkontakte.ru/g16527885/b_6e68053d.jpg", "type"=>"group", "photo_big"=>"http://cs884.vkontakte.ru/g16527885/a_ba67625c.jpg", "screen_name"=>"club16527885"}]
|
|
@@ -46,7 +45,7 @@ describe Vkontakte::Api::Groups do
|
|
|
46
45
|
|
|
47
46
|
it "should return group member" do
|
|
48
47
|
FakeWeb.register_uri(:get,
|
|
49
|
-
"https://api.vk.com/method/groups.isMember?access_token=#{@token}&gid=#{@group_id}&uid=81202312",
|
|
48
|
+
"https://api.vk.com/method/groups.isMember?v=5.24&access_token=#{@token}&gid=#{@group_id}&uid=81202312",
|
|
50
49
|
:body => '{"response":1}')
|
|
51
50
|
|
|
52
51
|
@iframe.groups.isMember(:uid => 81202312, :gid => @group_id).should == 1
|
|
@@ -54,7 +53,7 @@ describe Vkontakte::Api::Groups do
|
|
|
54
53
|
|
|
55
54
|
it "should return all groups members" do
|
|
56
55
|
FakeWeb.register_uri(:get,
|
|
57
|
-
"https://api.vk.com/method/groups.getMembers?access_token=#{@token}&gid=#{@group_id}&count=5",
|
|
56
|
+
"https://api.vk.com/method/groups.getMembers?v=5.24&access_token=#{@token}&gid=#{@group_id}&count=5",
|
|
58
57
|
:body => '{"response":{"count":29364,"users":[107765962,66506999,145557591,72256631,28639402]}}')
|
|
59
58
|
|
|
60
59
|
response = @iframe.groups.getMembers(:gid => @group_id, :count => 5)
|
|
@@ -65,7 +64,7 @@ describe Vkontakte::Api::Groups do
|
|
|
65
64
|
describe '#join' do
|
|
66
65
|
it 'should join to group' do
|
|
67
66
|
FakeWeb.register_uri(:get,
|
|
68
|
-
"https://api.vk.com/method/groups.join?access_token=#{@token}&gid=1", :body => '{"response":1}')
|
|
67
|
+
"https://api.vk.com/method/groups.join?v=5.24&access_token=#{@token}&gid=1", :body => '{"response":1}')
|
|
69
68
|
|
|
70
69
|
response = @iframe.groups.join(:gid => 1)
|
|
71
70
|
response.should == 1
|
|
@@ -75,7 +74,7 @@ describe Vkontakte::Api::Groups do
|
|
|
75
74
|
describe '#leave' do
|
|
76
75
|
it 'should allow user to leave group' do
|
|
77
76
|
FakeWeb.register_uri(:get,
|
|
78
|
-
"https://api.vk.com/method/groups.leave?access_token=#{@token}&gid=1", :body => '{"response":1}')
|
|
77
|
+
"https://api.vk.com/method/groups.leave?v=5.24&access_token=#{@token}&gid=1", :body => '{"response":1}')
|
|
79
78
|
|
|
80
79
|
response = @iframe.groups.leave(:gid => 1)
|
|
81
80
|
response.should == 1
|
data/spec/api/likes_spec.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe Vkontakte::Api::Likes do
|
|
@@ -15,7 +14,7 @@ describe Vkontakte::Api::Likes do
|
|
|
15
14
|
|
|
16
15
|
it 'should return user, liked this page' do
|
|
17
16
|
FakeWeb.register_uri(:get,
|
|
18
|
-
"https://api.vk.com/method/likes.getList?type=sitepage&page_url=http%3A%2F%2Fvk.com&owner_id=1&access_token=#{@token}",
|
|
17
|
+
"https://api.vk.com/method/likes.getList?v=5.24&type=sitepage&page_url=http%3A%2F%2Fvk.com&owner_id=1&access_token=#{@token}",
|
|
19
18
|
:body => '{"response":{"count":2,"users":[1,2]}}')
|
|
20
19
|
|
|
21
20
|
@iframe.likes.getList(:type => 'sitepage', :page_url => 'http://vk.com', :owner_id => 1).should eq ({"count" => 2, "users" => [1, 2]})
|
data/spec/api/photos_spec.rb
CHANGED
|
@@ -17,7 +17,7 @@ describe Vkontakte::Api::Photos do
|
|
|
17
17
|
"description":"","created":"1204576880","updated":"1229532461", "size":"3","privacy":"0"}]}'
|
|
18
18
|
|
|
19
19
|
FakeWeb.register_uri(:get,
|
|
20
|
-
"https://api.vk.com/method/photos.getAlbums?access_token=#{@token}",
|
|
20
|
+
"https://api.vk.com/method/photos.getAlbums?v=5.24&access_token=#{@token}",
|
|
21
21
|
:body => response)
|
|
22
22
|
|
|
23
23
|
@iframe.photos.getAlbums.should == [{"aid" => "17071606","thumb_id" => "98054577","owner_id" => "6492","title" => "", "description" => "","created" => "1204576880","updated" => "1229532461", "size" => "3","privacy" => "0"}]
|
|
@@ -27,7 +27,7 @@ describe Vkontakte::Api::Photos do
|
|
|
27
27
|
response = '{"response": { "items": [1,2,3] }}'
|
|
28
28
|
|
|
29
29
|
FakeWeb.register_uri(:get,
|
|
30
|
-
"https://api.vk.com/method/photos.getAllComments?access_token=#{@token}&owner_id=2592709",
|
|
30
|
+
"https://api.vk.com/method/photos.getAllComments?v=5.24&access_token=#{@token}&owner_id=2592709",
|
|
31
31
|
:body => response)
|
|
32
32
|
|
|
33
33
|
@iframe.photos.getAllComments(:owner_id => 2592709)["items"].size.should == 3
|
data/spec/api/profile_spec.rb
CHANGED
|
@@ -15,15 +15,15 @@ describe Vkontakte::Api::Profile do
|
|
|
15
15
|
friends_response = '{"response": {"count": 8, "items": [233297, 424407, 593420, 705017, 830116, 838081, 1075165, 1312768]}}'
|
|
16
16
|
|
|
17
17
|
FakeWeb.register_uri(:get,
|
|
18
|
-
"https://api.vk.com/method/users.get?uids=2592709&access_token=#{@token}",
|
|
18
|
+
"https://api.vk.com/method/users.get?v=5.24&uids=2592709&access_token=#{@token}",
|
|
19
19
|
:body => response)
|
|
20
20
|
|
|
21
21
|
FakeWeb.register_uri(:get,
|
|
22
|
-
"https://api.vk.com/method/users.getFollowers?user_id=2592709&access_token=#{@token}",
|
|
22
|
+
"https://api.vk.com/method/users.getFollowers?v=5.24&user_id=2592709&access_token=#{@token}",
|
|
23
23
|
:body => friends_response)
|
|
24
24
|
|
|
25
25
|
FakeWeb.register_uri(:get,
|
|
26
|
-
"https://api.vk.com/method/friends.get?user_id=2592709&access_token=#{@token}",
|
|
26
|
+
"https://api.vk.com/method/friends.get?v=5.24&user_id=2592709&access_token=#{@token}",
|
|
27
27
|
:body => friends_response)
|
|
28
28
|
end
|
|
29
29
|
|
data/spec/api/secure_spec.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
require "spec_helper"
|
|
3
2
|
|
|
4
3
|
describe Vkontakte::Api::Secure do
|
|
@@ -15,7 +14,7 @@ describe Vkontakte::Api::Secure do
|
|
|
15
14
|
:body => '{"access_token":"#{@token}"}')
|
|
16
15
|
|
|
17
16
|
@app = Vkontakte::App::Secure.new
|
|
18
|
-
@options = @app.secure.default_options.merge(:access_token => @token)
|
|
17
|
+
@options = @app.secure.default_options.merge(:access_token => @token, :v => '5.24')
|
|
19
18
|
end
|
|
20
19
|
|
|
21
20
|
it "should call sendNotification" do
|
data/spec/api/wall_spec.rb
CHANGED
|
@@ -13,7 +13,7 @@ describe Vkontakte::Api::Wall do
|
|
|
13
13
|
|
|
14
14
|
it 'should return user wall posts' do
|
|
15
15
|
FakeWeb.register_uri(:get,
|
|
16
|
-
"https://api.vk.com/method/wall.get?owner_id=2592709&access_token=#{@token}",
|
|
16
|
+
"https://api.vk.com/method/wall.get?v=5.24&owner_id=2592709&access_token=#{@token}",
|
|
17
17
|
:body => '{"response":{"count":2,"items":[1,2]}}')
|
|
18
18
|
|
|
19
19
|
@user.wall.get(:owner_id => 2592709).should eq ({"count" => 2, "items" => [1, 2]})
|
data/spec/apps/user_spec.rb
CHANGED
|
@@ -13,7 +13,7 @@ describe Vkontakte::App::User do
|
|
|
13
13
|
|
|
14
14
|
it "should load user profile" do
|
|
15
15
|
FakeWeb.register_uri(:get,
|
|
16
|
-
"https://api.vk.com/method/users.get?access_token=ACCESS_TOKEN&uids=uid",
|
|
16
|
+
"https://api.vk.com/method/users.get?v=5.24&access_token=ACCESS_TOKEN&uids=uid",
|
|
17
17
|
:body => '{"response":[{"uid":2592709, "last_name":"Галета", "first_name":"Павел"}]}')
|
|
18
18
|
|
|
19
19
|
@user.fetch.should_not be_blank
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vkontakte
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Igor Galeta
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-08-
|
|
12
|
+
date: 2014-08-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|