saki 0.0.0 → 0.0.1

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 +13 -20
  3. data/saki.gemspec +54 -0
  4. metadata +4 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -5,43 +5,37 @@ module Saki
5
5
  def default_factory(name)
6
6
  Factory name
7
7
  end
8
- def has_link_for(model, opts = {})
9
- href = "/#{model.class.to_s.tableize}/#{model.id}"
8
+
9
+ def add_opts(link, opts)
10
10
  if opts[:parent]
11
- href = "/#{opts[:parent].class.to_s.tableize}/#{opts[:parent].id}" + href
11
+ "/#{opts[:parent].class.to_s.tableize}/#{opts[:parent].id}" + link
12
+ else
13
+ link
12
14
  end
15
+ end
16
+
17
+ def has_link_for(model, opts = {})
18
+ href = add_opts "/#{model.class.to_s.tableize}/#{model.id}", opts
13
19
  page.should have_xpath("//a[@href='#{href}' and not(@rel)]")
14
20
  end
15
21
 
16
22
  def has_link_for_editing(model, opts = {})
17
- href = "/#{model.class.to_s.tableize}/#{model.id}/edit"
18
- if opts[:parent]
19
- href = "/#{opts[:parent].class.to_s.tableize}/#{opts[:parent].id}" + href
20
- end
23
+ href = add_opts "/#{model.class.to_s.tableize}/#{model.id}/edit", opts
21
24
  page.should have_xpath("//a[@href='#{href}']")
22
25
  end
23
26
 
24
27
  def has_link_for_deleting(model, opts = {})
25
- href = "/#{model.class.to_s.tableize}/#{model.id}"
26
- if opts[:parent]
27
- href = "/#{opts[:parent].class.to_s.tableize}/#{opts[:parent].id}" + href
28
- end
28
+ href = add_opts "/#{model.class.to_s.tableize}/#{model.id}", opts
29
29
  page.should have_xpath("//a[@href='#{href}' and @data-method='delete']")
30
30
  end
31
31
 
32
32
  def has_link_for_creating(model_type, opts = {})
33
- href = "/#{model_type.to_s.tableize}/new"
34
- if opts[:parent]
35
- href = "/#{opts[:parent].class.to_s.tableize}/#{opts[:parent].id}" + href
36
- end
33
+ href = add_opts "/#{model_type.to_s.tableize}/new", opts
37
34
  page.should have_xpath("//a[@href='#{href}']")
38
35
  end
39
36
 
40
37
  def has_link_for_indexing(model_type, opts = {})
41
- href = "/#{model_type.to_s.tableize}"
42
- if opts[:parent]
43
- href = "/#{opts[:parent].class.to_s.tableize}/#{opts[:parent].id}" + href
44
- end
38
+ href = add_opts "/#{model_type.to_s.tableize}", opts
45
39
  page.should have_xpath("//a[@href='#{href}']")
46
40
  end
47
41
 
@@ -123,5 +117,4 @@ module Saki
123
117
  end
124
118
  end
125
119
 
126
-
127
120
  RSpec.configuration.include Saki::AcceptanceHelpers, :type => :acceptance
@@ -0,0 +1,54 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{saki}
8
+ s.version = "0.0.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Nate Kidwell"]
12
+ s.date = %q{2010-08-30}
13
+ s.description = %q{Cucumber scenarios are lond and confusing sometimes. Release yourself from the tyranny of client-centered specing!}
14
+ s.email = %q{nate@ludicast.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.markdown"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.markdown",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/saki.rb",
27
+ "saki.gemspec",
28
+ "test/helper.rb",
29
+ "test/test_saki.rb"
30
+ ]
31
+ s.homepage = %q{http://github.com/ludicast/saki}
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = %q{1.3.7}
35
+ s.summary = %q{Allows terse acceptance testing}
36
+ s.test_files = [
37
+ "test/helper.rb",
38
+ "test/test_saki.rb"
39
+ ]
40
+
41
+ if s.respond_to? :specification_version then
42
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
+ s.specification_version = 3
44
+
45
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
+ s.add_development_dependency(%q<rspec>, [">= 0"])
47
+ else
48
+ s.add_dependency(%q<rspec>, [">= 0"])
49
+ end
50
+ else
51
+ s.add_dependency(%q<rspec>, [">= 0"])
52
+ end
53
+ end
54
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saki
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nate Kidwell
@@ -49,6 +49,7 @@ files:
49
49
  - Rakefile
50
50
  - VERSION
51
51
  - lib/saki.rb
52
+ - saki.gemspec
52
53
  - test/helper.rb
53
54
  - test/test_saki.rb
54
55
  has_rdoc: true