just_share 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 157f1596533933639f92d192331df8afa452de62
4
- data.tar.gz: 9ab827c7caea4c2f08d68a09f41f891d9caab869
3
+ metadata.gz: f7bb25986944dd6cb00bbaca5f4a6c2943e66ceb
4
+ data.tar.gz: 9347ba4a2ef291edc57a2c20a7e1e517566844b7
5
5
  SHA512:
6
- metadata.gz: 4acbdf271d6d793345bfd31ffd09c909e9c6d110f5ff0c974a7cfe22d1f0557647af8524badb1ca3eb631f5efcf7363683d51e5204db46e5775d75629afb8451
7
- data.tar.gz: d0199fa4e03c2b7bcd2071504f772b80474dd7d23ac75e6b99f4e2830c875b509370bd36e7be358e4a45110a9f5faa10913f3728b65675d1b4329736e475f956
6
+ metadata.gz: f8752359e84873eb68c0b409ade65118489d24ff889f8c0f8b100081453f2c2aa8fda20de71732ec5c7dd3f456f92b4601a6f70fa04ab068f43eb850019470e8
7
+ data.tar.gz: 1f8741be0838927c6067d878cea82261facb56cbdd47f4f10bcba9f943972191d58e734c249b8aab4cab5fcc00547c8c10390d2313aa00dd3063f866dea971ad
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- just_share (1.0.13)
4
+ just_share (1.0.14)
5
5
  colorize (~> 0.7.3, >= 0.7.3)
6
6
  multi_json (~> 1.10, >= 1.10.1)
7
7
  rest-client (~> 1.7, >= 1.7.2)
@@ -10,4 +10,13 @@ class JustShare::Facebook < JustShare::SocialLinker
10
10
  # build the params
11
11
  self.params = "#{url_param}"
12
12
  end
13
+
14
+ def self.invite_friends app_id, msg, redir_url
15
+ # Base URL
16
+ domain='https://www.facebook.com'
17
+ path='dialog/apprequests'
18
+ params = "app_id=#{app_id}&message=#{msg}&redirect_uri=#{redir_url}"
19
+
20
+ "#{domain}/#{path}?#{params}"
21
+ end
13
22
  end
@@ -1,6 +1,6 @@
1
1
  module JustShare
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- PATCH = 13
4
+ PATCH = 14
5
5
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
6
6
  end
@@ -11,11 +11,17 @@ describe JustShare do
11
11
  @hash_tags = ['partiu','partiu2']
12
12
  @url_image = 'https://avatars3.githubusercontent.com/u/7591935'
13
13
 
14
+ # Face invite
15
+ @inv_app_id = '128300630673976'
16
+ @inv_msg = 'Invite all your friends!'
17
+ @inv_redir_url = 'https://apps.facebook.com/proumoevents'
18
+
14
19
  # Global useful vars
15
20
  @base_hash = {via:@via, link:@link, title:@title, message:@message, hash_tags:@hash_tags, image_url:@url_image}
16
21
 
17
22
  # Expected URLs generated:
18
23
  @link = CGI::escape(@link)
24
+ @face_invite_expected_url = "https://www.facebook.com/dialog/apprequests?app_id=#{@inv_app_id}&message=#{@inv_msg}&redirect_uri=#{@inv_redir_url}"
19
25
  @facebook_expected_url = "https://www.facebook.com/sharer/sharer.php?u=#{@link}"
20
26
  @twitter_expected_url = "https://twitter.com/intent/tweet?text=#{@message}&url=#{@link}&via=#{@via}&hashtags=#{JustShare.array_to_str_params(@hash_tags)}"
21
27
  @google_plus_expected_url = "https://plus.google.com/share?url=#{@link}"
@@ -55,6 +61,13 @@ describe JustShare do
55
61
  #expect(accessible?(@url_generated)).to be_truthy
56
62
  end
57
63
 
64
+ it "Facebook invite friends" do
65
+ @url_generated = JustShare::Facebook.invite_friends(app_id=@inv_app_id, msg=@inv_msg, redir_url=@inv_redir_url)
66
+ puts @url_generated
67
+ expect(@url_generated).to be_equals @face_invite_expected_url
68
+ #expect(accessible?(@url_generated)).to be_truthy
69
+ end
70
+
58
71
  it "Twitter" do
59
72
  @base_hash[:social] = :twitter
60
73
  @url_generated = JustShare.on(@base_hash)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: just_share
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilton Garcia