2019-12-17 18:36:19 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-11 15:51:20 +08:00
|
|
|
Then(/^I click on Avatar$/) do
|
|
|
|
find('img.avatar').click
|
|
|
|
end
|
|
|
|
|
|
|
|
Given(/^I'm on the profile page$/) do
|
2018-01-31 19:05:45 +08:00
|
|
|
visit edit_user_registration_path
|
2017-10-11 15:51:20 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^I click on Browse button$/) do
|
|
|
|
find('input#user_avatar').click
|
2017-10-10 15:17:55 +08:00
|
|
|
end
|
2017-10-16 22:21:52 +08:00
|
|
|
|
|
|
|
Then(/^I change "([^"]*)" with "([^"]*)" email$/) do |prev_email, new_email|
|
2017-10-24 15:45:35 +08:00
|
|
|
wait_for_ajax
|
2017-10-24 21:39:06 +08:00
|
|
|
find(:css, "input[value='#{prev_email}']").set(new_email)
|
2017-10-16 22:21:52 +08:00
|
|
|
end
|
|
|
|
|
2018-01-31 19:05:45 +08:00
|
|
|
Then(/^I fill in "([^"]*)" in "([^"]*)" field of "([^"]*)" form$/) do |password, field, form_id|
|
|
|
|
within form_id do
|
2018-02-12 18:42:22 +08:00
|
|
|
find(field).set(password)
|
2018-01-31 19:05:45 +08:00
|
|
|
end
|
2017-10-16 22:21:52 +08:00
|
|
|
end
|
2019-12-17 18:21:49 +08:00
|
|
|
|
|
|
|
Then(/^I change "([^"]*)" with "([^"]*)"$/) do |prev_email, new_email|
|
|
|
|
wait_for_ajax
|
|
|
|
find(:css, "input[value='#{prev_email}']").set(new_email)
|
2019-12-17 18:36:19 +08:00
|
|
|
end
|