coulda_web_steps 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +18 -2
- data/VERSION +1 -1
- data/coulda_web_steps.gemspec +4 -4
- data/lib/coulda_web_steps.rb +7 -1
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -1,10 +1,26 @@
|
|
1
1
|
= coulda_web_steps
|
2
2
|
|
3
|
-
Coulda
|
3
|
+
Coulda Web Steps provides some reusable steps for Coulda acceptance testing
|
4
|
+
of Rack/Rails applications.
|
4
5
|
|
6
|
+
== Conventions
|
7
|
+
* Factories are used to create objects
|
8
|
+
* Factoried objects are stored in instance variables on the test object
|
9
|
+
* Factoried objects are accessible at class scope by name using Symbols.
|
5
10
|
|
6
|
-
|
11
|
+
Coulda web steps uses Symbols as a convention to reference instance variables at class scope.
|
12
|
+
|
13
|
+
For instance:
|
14
|
+
|
15
|
+
when_i_visit :job, :job_instance
|
7
16
|
|
17
|
+
Calls [https://github.com/jnicklas/capybara Capybara]'s #visit method
|
18
|
+
with "job_path(@job_instance)" where job_path is mapped from :job
|
19
|
+
(adding "_path" is a convention to support Rails) and @job_instance
|
20
|
+
is mapped directly from :job_instance.
|
21
|
+
|
22
|
+
|
23
|
+
== Usage
|
8
24
|
Write the following in your test_helper:
|
9
25
|
|
10
26
|
Coulda.default_test_case_class = Test::Unit::TestCase
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/coulda_web_steps.gemspec
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{coulda_web_steps}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["elight"]
|
12
|
-
s.date = %q{2010-12-
|
13
|
-
s.description = %q{
|
12
|
+
s.date = %q{2010-12-24}
|
13
|
+
s.description = %q{Provides reusable steps for Coulda acceptance testing of Rack/Rails applications}
|
14
14
|
s.email = %q{evan@tripledogdare.net}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.licenses = ["MIT"]
|
32
32
|
s.require_paths = ["lib"]
|
33
33
|
s.rubygems_version = %q{1.3.7}
|
34
|
-
s.summary = %q{
|
34
|
+
s.summary = %q{Provides reusable steps for Coulda acceptance testing of Rack/Rails applications}
|
35
35
|
|
36
36
|
if s.respond_to? :specification_version then
|
37
37
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
data/lib/coulda_web_steps.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'coulda'
|
2
|
+
require 'json'
|
3
|
+
|
1
4
|
module Coulda
|
2
5
|
module WebSteps
|
3
6
|
# Creates an object using a factory_girl factory and creates a Given step that reads like
|
@@ -71,7 +74,10 @@ module Coulda
|
|
71
74
|
def when_i_visit(path, *args)
|
72
75
|
humanized_path = path.to_s.gsub /_/, " "
|
73
76
|
When "I visit the #{humanized_path}" do
|
74
|
-
|
77
|
+
instance_var_args = args.inject([]) do |new_args, arg|
|
78
|
+
new_args << instance_variable_get("@#{arg}")
|
79
|
+
end
|
80
|
+
visit __send__(path, *instance_var_args)
|
75
81
|
end
|
76
82
|
end
|
77
83
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 0.6.
|
8
|
+
- 2
|
9
|
+
version: 0.6.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- elight
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-24 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -135,7 +135,7 @@ dependencies:
|
|
135
135
|
version: 1.5.1
|
136
136
|
type: :development
|
137
137
|
version_requirements: *id008
|
138
|
-
description:
|
138
|
+
description: Provides reusable steps for Coulda acceptance testing of Rack/Rails applications
|
139
139
|
email: evan@tripledogdare.net
|
140
140
|
executables: []
|
141
141
|
|
@@ -185,6 +185,6 @@ rubyforge_project:
|
|
185
185
|
rubygems_version: 1.3.7
|
186
186
|
signing_key:
|
187
187
|
specification_version: 3
|
188
|
-
summary:
|
188
|
+
summary: Provides reusable steps for Coulda acceptance testing of Rack/Rails applications
|
189
189
|
test_files: []
|
190
190
|
|