utensils 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -72,10 +72,11 @@ Resets timecop after each spec
72
72
 
73
73
  ### upload_macros
74
74
 
75
- Provides fixture_file helper pointing to spec/fixtures directory
75
+ Provides fixture_file and fixture_file_path helper pointing to spec/fixtures directory
76
76
 
77
77
  ```ruby
78
- Photo.create(:file => fixture_file('dummy.jpg')) #attaches spec/fixtures/dummy.jpg
78
+ fixture_file_path('dummy.jpg') # 'spec/fixtures/dummy.jpg'
79
+ Photo.create(:file => fixture_file('dummy.jpg')) # attaches File spec/fixtures/dummy.jpg
79
80
  ```
80
81
 
81
82
  ### vcr
@@ -113,23 +113,25 @@ module Utensils
113
113
  class Ordered
114
114
  def initialize(args)
115
115
  @within = args.pop[:within]
116
- @models = args
116
+ @selectors = args.map do |selector|
117
+ selector.is_a?(String) ? selector : '#' + ApplicationController.helpers.dom_id(selector)
118
+ end
117
119
  end
118
120
 
119
121
  def matches?(page)
120
122
  @page = page
121
- @models.each_with_index do |model,i|
122
- return false unless @page.has_css?("#{@within} ##{ApplicationController.helpers.dom_id(model)}:nth-child(#{i+1})")
123
+ @selectors.each_with_index do |selector,i|
124
+ return false unless @page.has_css?("#{@within} #{selector}:nth-child(#{i+1})")
123
125
  end
124
126
  true
125
127
  end
126
128
 
127
129
  def failure_message_for_should
128
- "expected #{@page.body} to have models in this order: #{@models.inspect}"
130
+ "expected #{@page.body} to have elements in this order: #{@selectors.inspect}"
129
131
  end
130
132
 
131
133
  def failure_message_for_should_not
132
- "expected #{@page.body} to not have models in this order: #{@models.inspect}"
134
+ "expected #{@page.body} to not have elements in this order: #{@selectors.inspect}"
133
135
  end
134
136
  end
135
137
 
@@ -1,3 +1,3 @@
1
1
  module Utensils
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utensils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-30 00:00:00.000000000 Z
12
+ date: 2013-03-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Rspec stuff we use over and over again
15
15
  email:
@@ -46,18 +46,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
46
  - - ! '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
- segments:
50
- - 0
51
- hash: -1360619607075634307
52
49
  required_rubygems_version: !ruby/object:Gem::Requirement
53
50
  none: false
54
51
  requirements:
55
52
  - - ! '>='
56
53
  - !ruby/object:Gem::Version
57
54
  version: '0'
58
- segments:
59
- - 0
60
- hash: -1360619607075634307
61
55
  requirements: []
62
56
  rubyforge_project:
63
57
  rubygems_version: 1.8.23