master
1require_relative "../page_model.rb"
2
3class NewGymPage < PageModel
4 attr_reader :form_id
5
6 def initialize
7 super new_gym_path
8 @form_id = "#new_gym"
9 end
10
11 def change(name:, address:, city:, region:, country:, postal_code:)
12 within form_id do
13 fill_in "gym_name", with: name
14 fill_in "gym_location_attributes_address", with: address
15 fill_in "gym_location_attributes_city", with: city
16 fill_in "gym_location_attributes_region", with: region
17 select country, from: "gym_location_attributes_country"
18 fill_in "gym_location_attributes_postal_code", with: postal_code
19 click_button "Save"
20 end
21 end
22end