saki 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/saki.rb +16 -1
  3. data/saki.gemspec +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -157,7 +157,13 @@ module Saki
157
157
  end
158
158
 
159
159
  def has_link(href)
160
- page.should have_xpath("//a[@href='#{href}']")
160
+ begin
161
+ page.should have_xpath("//a[@href='#{href}']")
162
+ rescue
163
+ onclick = "javascript: window.location='/pages/new';"
164
+ page.should have_xpath(%{//button[@onclick="#{onclick}"]})
165
+ end
166
+
161
167
  end
162
168
 
163
169
  def has_link_for(model, opts = {})
@@ -215,6 +221,15 @@ module Saki
215
221
  end
216
222
  end
217
223
 
224
+ def visiting_path path, &block
225
+ context "on visiting" do
226
+ before do
227
+ visit (instance_eval &path)
228
+ end
229
+ module_eval &block
230
+ end
231
+ end
232
+
218
233
 
219
234
  def add_opts(link, opts, context)
220
235
  if opts[:parent]
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{saki}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nate Kidwell"]
12
- s.date = %q{2010-10-15}
12
+ s.date = %q{2010-10-16}
13
13
  s.description = %q{Cucumber scenarios are long and confusing sometimes. Release yourself from the tyranny of client-centered specing!}
14
14
  s.email = %q{nate@ludicast.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nate Kidwell
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-15 00:00:00 -04:00
17
+ date: 2010-10-16 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency