picture_from 1.0.0 → 1.0.1
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/picture_from/search_engine.rb +1 -0
- data/lib/picture_from/version.rb +1 -1
- data/spec/lib/picture_from/facebook_picture_spec.rb +18 -1
- data/spec/lib/picture_from/twitter_picture_spec.rb +11 -2
- data/spec/spec_helper.rb +1 -0
- metadata +1 -3
- data/spec/lib/picture_from/search_engine_spec.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23aea69a8712e80042dbc252a4838a8846d2edb4
|
4
|
+
data.tar.gz: ac517c481ac4adf814b04b5462986874bc64a5fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6fdbfc7d7bc0411bd56cf49cfc366bc2c3818534114d3c5b2283b558ea2323ccfa8669e3de71c64c003783443c26a7ec4f1d7898219bfeea2b7c3b7f260623a
|
7
|
+
data.tar.gz: faa0aaac0eecffd5b067a26e655e0e3fe4b0e587055ac38519cb612fef50e3318f4c3aae53625b4792b4157bee0089c7ae4900f337ba581ecc4ad8b7c9de67f6
|
data/lib/picture_from/version.rb
CHANGED
@@ -6,12 +6,29 @@ describe PictureFrom::FacebookPicture do
|
|
6
6
|
subject { described_class.new }
|
7
7
|
|
8
8
|
it 'returns the image url' do
|
9
|
+
fake('http://graph.facebook.com/karreiro/picture',
|
10
|
+
status: 302,
|
11
|
+
message: 'Found',
|
12
|
+
location: 'https://fbcdn-profile-a.akamaihd.net/image.png')
|
13
|
+
|
9
14
|
link = subject.picture_from_username('karreiro')
|
10
15
|
expect(link).to eq('http://graph.facebook.com/karreiro/picture')
|
11
16
|
end
|
12
17
|
end
|
13
18
|
|
14
|
-
describe '
|
19
|
+
describe '#picture_from_user_info' do
|
20
|
+
subject { described_class.new }
|
21
|
+
|
22
|
+
it 'returns the image url' do
|
23
|
+
fake('https://www.facebook.com/search.php?q=karreiro@gmail.com',
|
24
|
+
file: 'facebook_crawler.response')
|
25
|
+
|
26
|
+
link = subject.picture_from_user_info('karreiro@gmail.com')
|
27
|
+
expect(link).to eq('http://graph.facebook.com/karreiro/picture')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe 'online tests', online: true do
|
15
32
|
|
16
33
|
describe '#picture_from_user_info' do
|
17
34
|
subject { described_class.new }
|
@@ -2,7 +2,17 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe PictureFrom::TwitterPicture do
|
4
4
|
|
5
|
-
describe '
|
5
|
+
describe '#picture_from_username' do
|
6
|
+
subject { described_class.new }
|
7
|
+
|
8
|
+
it 'returns the image url' do
|
9
|
+
fake('https://twitter.com/g_carreiro', file: 'twitter_crawler.response')
|
10
|
+
link = subject.picture_from_username('g_carreiro')
|
11
|
+
expect(link).to eq('https://pbs.twimg.com/profile_images/524721838002143233/nNdh6ftm_400x400.jpeg')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'online tests', online: true do
|
6
16
|
|
7
17
|
describe '#picture_from_username' do
|
8
18
|
subject { described_class.new }
|
@@ -14,5 +24,4 @@ describe PictureFrom::TwitterPicture do
|
|
14
24
|
end
|
15
25
|
|
16
26
|
end
|
17
|
-
|
18
27
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picture_from
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Carreiro
|
@@ -159,7 +159,6 @@ files:
|
|
159
159
|
- spec/lib/picture_from/facebook_picture_spec.rb
|
160
160
|
- spec/lib/picture_from/gravatar_picture_spec.rb
|
161
161
|
- spec/lib/picture_from/keyword_spec.rb
|
162
|
-
- spec/lib/picture_from/search_engine_spec.rb
|
163
162
|
- spec/lib/picture_from/twitter_picture_spec.rb
|
164
163
|
- spec/lib/picture_from_spec.rb
|
165
164
|
- spec/spec_helper.rb
|
@@ -199,7 +198,6 @@ test_files:
|
|
199
198
|
- spec/lib/picture_from/facebook_picture_spec.rb
|
200
199
|
- spec/lib/picture_from/gravatar_picture_spec.rb
|
201
200
|
- spec/lib/picture_from/keyword_spec.rb
|
202
|
-
- spec/lib/picture_from/search_engine_spec.rb
|
203
201
|
- spec/lib/picture_from/twitter_picture_spec.rb
|
204
202
|
- spec/lib/picture_from_spec.rb
|
205
203
|
- spec/spec_helper.rb
|