just_share 1.0.13 → 1.0.14
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/Gemfile.lock +1 -1
- data/lib/just_share/facebook.rb +9 -0
- data/lib/just_share/version.rb +1 -1
- data/spec/just_share/just_share_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7bb25986944dd6cb00bbaca5f4a6c2943e66ceb
|
4
|
+
data.tar.gz: 9347ba4a2ef291edc57a2c20a7e1e517566844b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8752359e84873eb68c0b409ade65118489d24ff889f8c0f8b100081453f2c2aa8fda20de71732ec5c7dd3f456f92b4601a6f70fa04ab068f43eb850019470e8
|
7
|
+
data.tar.gz: 1f8741be0838927c6067d878cea82261facb56cbdd47f4f10bcba9f943972191d58e734c249b8aab4cab5fcc00547c8c10390d2313aa00dd3063f866dea971ad
|
data/Gemfile.lock
CHANGED
data/lib/just_share/facebook.rb
CHANGED
@@ -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
|
data/lib/just_share/version.rb
CHANGED
@@ -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)
|