-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* script/generate pickle path[s] now amends the features/support/pat…
…hs.rb file instead of creating pge_to_path and path_steps. * pickle_email_steps is renamed email_steps
- Loading branch information
Showing
16 changed files
with
118 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
../../rails_generators/pickle/templates/email_steps.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
Given(/^an email "(.*?)" with body: "(.*?)" is delivered to (.+?)$/) do |subject, body, to| | |||
Notifier.deliver_email(to, subject, body) | |||
end | |||
|
|||
Given(/^#{capture_model}'s email is delivered$/) do |model| | |||
Notifier.deliver_user_email(model(model)) | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,12 @@ | |||
Then(/^(.+?) page should match route \/(.+?)$/) do |page, route| | Then(/^(.+?) should match route \/(.+?)$/) do |page, route| | ||
regexp = route.gsub(/:(\w*?)id/,'\d+') | regexp = route.gsub(/:(\w*?)id/,'\d+') | ||
page_to_path(page).should =~ /#{regexp}/ | path_to(page).should =~ /#{regexp}/ | ||
end | |||
|
|||
When(/^I go to (.+)$/) do |page| | |||
visit path_to(page) | |||
end | |||
|
|||
Then(/^I should be at (.+)$/) do |page| | |||
request.path.should =~ /#{path_to(page)}/ | |||
end | end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
def path_to(page_name) | |||
case page_name | |||
|
|||
when /the homepage/i | |||
root_path | |||
|
|||
# Add more page name => path mappings here | |||
|
|||
# added by script/generate pickle path | |||
|
|||
when /^#{capture_model}'s page$/ # eg. the forum's page | |||
pickle_path $1 | |||
|
|||
when /^#{capture_model}'s #{capture_model}'s page$/ # eg. the forum's post's page | |||
pickle_path $1, $2 | |||
|
|||
when /^#{capture_model}'s #{capture_model}'s (.+?) page$/ # eg. the forum's post's comments page | |||
pickle_path $1, $2, :extra => $3 # or the forum's post's edit page | |||
|
|||
when /^#{capture_model}'s (.+?) page$/ # eg. the forum's posts page | |||
pickle_path $1, :extra => $2 # or the forum's edit page | |||
|
|||
when /^the (.+?) page$/ # translate to named route | |||
send "#{$1.downcase.gsub(' ','_')}_path" | |||
|
|||
# end added by pickle path | |||
|
|||
else | |||
raise "Can't find mapping from \"#{page_name}\" to a path." | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,12 +1,14 @@ | |||
<%= current_env %> | <%= current_env -%> | ||
<% if pickle %>require 'pickle/world'<% end %> | <%- if pickle -%> | ||
<% if pickle_path %>require 'pickle/path/world'<% end %> | require 'pickle/world' | ||
<% if pickle_email %>require 'pickle/email/world'<% end %> | |||
<% if pickle %> | |||
# Example of configuring pickle: | # Example of configuring pickle: | ||
# | # | ||
# Pickle.configure do |config| | # Pickle.configure do |config| | ||
# config.adaptors = [:machinist] | # config.adaptors = [:machinist] | ||
# config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"' | # config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"' | ||
# end | # end | ||
<% end -%> | <%- end -%> | ||
<%- if pickle_path -%>require 'pickle/path/world' | |||
<%- end -%> | |||
<%- if pickle_email -%>require 'pickle/email/world' | |||
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
<%= current_paths_header %> | |||
# added by script/generate pickle path | |||
when /^#{capture_model}'s page$/ # eg. the forum's page | |||
pickle_path $1 | |||
when /^#{capture_model}'s #{capture_model}'s page$/ # eg. the forum's post's page | |||
pickle_path $1, $2 | |||
when /^#{capture_model}'s #{capture_model}'s (.+?) page$/ # eg. the forum's post's comments page | |||
pickle_path $1, $2, :extra => $3 # or the forum's post's edit page | |||
|
|||
when /^#{capture_model}'s (.+?) page$/ # eg. the forum's posts page | |||
pickle_path $1, :extra => $2 # or the forum's edit page | |||
|
|||
when /^the (.+?) page$/ # translate to named route | |||
send "#{$1.downcase.gsub(' ','_')}_path" | |||
|
|||
# end added by pickle path | |||
<%= current_paths_footer %> |
This file was deleted.
Oops, something went wrong.