schlick-pickle 0.1.5.2 → 0.1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/lib/pickle/version.rb +2 -1
- data/rails_generators/pickle/templates/page_steps.rb +49 -0
- metadata +2 -1
data/History.txt
CHANGED
data/lib/pickle/version.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
# this file generated by script/generate pickle page
|
2
|
+
|
3
|
+
When(/^I go to \/(.+?)$/) do |path|
|
4
|
+
visit "/#{path}"
|
5
|
+
end
|
6
|
+
|
7
|
+
Then(/^I should be at \/(.+?)$/) do |path|
|
8
|
+
request.path.should =~ /^\/#{path}/
|
9
|
+
end
|
10
|
+
|
11
|
+
When(/^I go to (.+?) page$/) do |page|
|
12
|
+
visit page_to_path(page)
|
13
|
+
end
|
14
|
+
|
15
|
+
Then(/^I should be at (.+?) page$/) do |page|
|
16
|
+
request.path.should =~ /^#{page_to_path(page)}/
|
17
|
+
end
|
18
|
+
|
19
|
+
# passed a string like 'the home', returns a path
|
20
|
+
def page_to_path(page)
|
21
|
+
case page
|
22
|
+
|
23
|
+
# add your own app-specific mappings, e.g.
|
24
|
+
#
|
25
|
+
# when 'the home'
|
26
|
+
# '/'
|
27
|
+
#
|
28
|
+
# when /$#{capture_model}'s activation^/
|
29
|
+
# activation_by_code_path(created_model($1).activation_code)
|
30
|
+
|
31
|
+
when /^#{capture_model}'s$/ # the forum's
|
32
|
+
find_path_for $1
|
33
|
+
|
34
|
+
when /^#{capture_model}'s #{capture_model}'s$/ # the forum's post's
|
35
|
+
find_path_for $1, $2
|
36
|
+
|
37
|
+
when /^#{capture_model}'s #{capture_model}'s (.+?)$/ # the forum's post's comments
|
38
|
+
find_path_for $1, $2, :extra => $3
|
39
|
+
|
40
|
+
when /^#{capture_model}'s (.+?)$/ # the post's comments
|
41
|
+
find_path_for $1, :extra => $2
|
42
|
+
|
43
|
+
when /^the (.+?)$/ # the new session # => new_session_path
|
44
|
+
send "#{$1.downcase.gsub(' ','_')}_path"
|
45
|
+
|
46
|
+
else
|
47
|
+
raise "Could not map '#{page}' to a path"
|
48
|
+
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schlick-pickle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.5.
|
4
|
+
version: 0.1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian White
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- lib/pickle.rb
|
35
35
|
- rails_generators/pickle/pickle_generator.rb
|
36
36
|
- rails_generators/pickle/templates/env.rb
|
37
|
+
- rails_generators/pickle/templates/page_steps.rb
|
37
38
|
- rails_generators/pickle/templates/pickle_steps.rb
|
38
39
|
- License.txt
|
39
40
|
- README.textile
|