I have two questions related to the following steps:
1. I've read the documentation and thought that arguments could be passed in quoted or not quoted. I'm unable to pass in "email_password" in the last step unless it is quoted. Is there some specific to define in the step to have this behavior? It seems to work fine when I pass in an unquoted parameter to a defined placeholder.
2. I have the last step working by calling step and interpolating the string for the variable. It does not seem possible to do this with the send method as the placeholder for :credential is bypassed? Is there any way to change email_password to :credential to take advantage of the placeholder I defined and past that along to the steps?
step "I registered as admin :credentials" do |credentials|
create(:user, :admin, email: credentials[:email], password: credentials[:password])
end
step "I login as :credentials" do |credentials|
visit login_path
fill_in 'Email', :with => credentials[:email]
fill_in 'Password', :with => credentials[:password]
click_button 'Login'
end
step "I am logged in as admin :email_password" do |email_password|
send "I registered as admin :credentials", email_password
send "I login as :credentials", email_password
# step "I registered as admin #{email_password}"
# step "I login as #{email_password}"
end
Thanks,
Eric