utensils 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -5
- data/lib/utensils/custom_matchers.rb +24 -16
- data/lib/utensils/version.rb +1 -1
- metadata +3 -4
- data/lib/utensils/spring.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa13c9cc6c23f59e2154c6ab07af4ced90124281
|
4
|
+
data.tar.gz: 345de22c5d7ba9fed713f4cb0f15fab326aee340
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7694526df301f3dc2e74ef77c3149e1031c6a33bad55a14f695df174d62cbd33dae55718327dc9bceca45ef9eb4cf80217328db5709ed465b57c5ccad4fa5b95
|
7
|
+
data.tar.gz: cf2e151022a1dfa5e4dbe9ce27f4d6b5f6211f4a524533d4ec7c611d8a310d051a4026393be596b50226f55fb082baecbc2124fe77c7a8899c8a60d7e766cfa4
|
data/README.md
CHANGED
@@ -21,7 +21,6 @@ require 'utensils/custom_matchers'
|
|
21
21
|
require 'utensils/database_cleaner'
|
22
22
|
require 'utensils/factory_girl'
|
23
23
|
require 'utensils/omniauth'
|
24
|
-
require 'utensils/spring'
|
25
24
|
require 'utensils/timecop'
|
26
25
|
require 'utensils/upload_macros'
|
27
26
|
require 'utensils/vcr'
|
@@ -83,10 +82,6 @@ stub_oauth_error(:facebook)
|
|
83
82
|
login(user)
|
84
83
|
```
|
85
84
|
|
86
|
-
### spring
|
87
|
-
|
88
|
-
Reloads factories because spring doesn't
|
89
|
-
|
90
85
|
### timecop
|
91
86
|
|
92
87
|
Resets timecop after each spec
|
@@ -72,7 +72,11 @@ module Utensils
|
|
72
72
|
|
73
73
|
def matches?(page)
|
74
74
|
@page = page
|
75
|
-
@image.is_a?(String)
|
75
|
+
if @image.is_a?(String)
|
76
|
+
find_by_url || find_lazy_loaded_image
|
77
|
+
else
|
78
|
+
find_dragonfly_image
|
79
|
+
end
|
76
80
|
end
|
77
81
|
|
78
82
|
def failure_message
|
@@ -85,25 +89,29 @@ module Utensils
|
|
85
89
|
|
86
90
|
private
|
87
91
|
|
88
|
-
|
89
|
-
|
90
|
-
|
92
|
+
def find_by_url
|
93
|
+
@page.has_css?("img[src$='#{@image}']")
|
94
|
+
end
|
91
95
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
96
|
+
def find_lazy_loaded_image
|
97
|
+
@page.has_css?("img[data-original$='#{@image}']")
|
98
|
+
end
|
99
|
+
|
100
|
+
def find_dragonfly_image
|
101
|
+
@page.all('img').each do |img|
|
102
|
+
url = img['src']
|
103
|
+
dragonfly_hash = url[/media\/([^\/.]+)/, 1]
|
104
|
+
if dragonfly_hash
|
105
|
+
begin
|
106
|
+
dragonfly_job = Dragonfly::Job.deserialize(dragonfly_hash, Dragonfly[:images])
|
107
|
+
return true if dragonfly_job.uid == @image.send(:uid)
|
108
|
+
rescue Dragonfly::Serializer::BadString
|
109
|
+
next
|
110
|
+
end
|
102
111
|
end
|
103
112
|
end
|
113
|
+
return false
|
104
114
|
end
|
105
|
-
return false
|
106
|
-
end
|
107
115
|
end
|
108
116
|
|
109
117
|
def have_image(image_url)
|
data/lib/utensils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utensils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rspec stuff we use over and over again
|
14
14
|
email:
|
@@ -30,7 +30,6 @@ files:
|
|
30
30
|
- lib/utensils/database_cleaner.rb
|
31
31
|
- lib/utensils/factory_girl.rb
|
32
32
|
- lib/utensils/omniauth.rb
|
33
|
-
- lib/utensils/spring.rb
|
34
33
|
- lib/utensils/timecop.rb
|
35
34
|
- lib/utensils/upload_macros.rb
|
36
35
|
- lib/utensils/vcr.rb
|
@@ -55,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
54
|
version: '0'
|
56
55
|
requirements: []
|
57
56
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.2.2
|
59
58
|
signing_key:
|
60
59
|
specification_version: 4
|
61
60
|
summary: Rspec stuff we use over and over again
|