Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
features/support/email.rb adds an email helper for mapping names to e…
…mail addresses (similar to NavigationHelper in paths.rb)
- Loading branch information
Showing
6 changed files
with
49 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../rails_generators/pickle/templates/email.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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module EmailHelpers | ||
# Maps a name to an email address. Used by email_steps | ||
|
||
def email_for(to) | ||
case to | ||
|
||
# add your own name => email address mappings here | ||
|
||
when /^#{capture_model}$/ | ||
model($1).email | ||
|
||
when /^"(.*)"$/ | ||
$1 | ||
|
||
else | ||
to | ||
end | ||
end | ||
end | ||
|
||
World(EmailHelpers) |
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