master
 1require_relative "../page_model.rb"
 2
 3class EditProfilePage < PageModel
 4  def initialize(user)
 5    super edit_profile_path(user)
 6  end
 7
 8  def change(gender: :male, social_tolerance: :low)
 9    within(".edit_profile") do
10      page.choose(gender.to_s.titleize)
11      page.choose(social_tolerance.to_s.titleize)
12    end
13  end
14
15  def choose_home_gym(city:, name:)
16    within("#gym-search form") do
17      fill_in "q", with: name
18      fill_in "city", with: city
19      click_button("Search")
20    end
21    wait_for_ajax
22    click_button("Mine")
23    wait_for_ajax
24  end
25
26  def save_changes
27    within(".edit_profile") do
28      click_button translate("profiles.edit.save")
29    end
30  end
31end