When(/^he saves experiences$/) do
  click_button('Save experiences')
end

Then(/^the first experience should be "(.*?)"$/) do |experience|
  expect(
    page.first(:css, "form[action='/update_experiences']").
         first(:css, ".edit-option").first(:css, "input").value
    ).to eql(experience)
end

When(/^he moves "(.*?)" to the top experience$/) do |experience|
  page.find(:css, "input[id='move_#{experience.squish.downcase.tr(" ","_")}']").find('option["0"]').click
end


When(/^he saves experiences$/) do
  click_button('Save experiences')
end

Then(/^the first experience should be "(.*?)"$/) do |experience|
  expect(
    page.first(:css, "form[action='/update_experiences']").
         first(:css, ".edit-option").first(:css, "input").value
    ).to eql(experience)
end

When(/^he moves "(.*?)" to the top experience$/) do |experience|
  page.find(:css, "select[id='#{experience.squish.downcase.tr(" ","_")}_position']").find("option[value='0']").click
end


Fix order experience cucumber test to find position select on page
Fix order experience cucumber test to find position select on page
