otwarchive-symphonyarchive/features/support/email.rb

26 lines
385 B
Ruby
Raw Normal View History

2026-03-11 22:22:11 +00:00
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 /^"([^@]*)"$/
user = User.find_by(login: $1)
user.email
when /^"(.*)"$/
$1
else
to
end
end
end
World(EmailHelpers)