master
 1When(/^the user is on the gyms page$/) do
 2  @subject = GymsPage.new
 3  @subject.visit_page
 4end
 5
 6And(/^There are (.*) gyms$/) do |n|
 7  @gyms = n.to_i.times.map do
 8    FactoryGirl.create(:gym)
 9  end
10end
11
12Then(/^it lists all gyms$/) do
13  @gyms.each do |gym|
14    expect(@subject).to have_content(gym.name)
15  end
16end
17
18When(/^they search for a city/) do
19  gym = @gyms.sample
20  @subject.search(gym.location.city)
21  @gyms = [gym]
22end