otwa-aggie/features/support/email.rb
2026-08-13 00:44:25 -04:00

25 lines
385 B
Ruby

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)