title: Capybara Action integer (id) vs. string (name) confusion
body: <p>Part of my test requires selecting a university from this form field:</p>
  
  <pre><code>&lt;div class="js-dependent-fields" data-select-id="user_role" data-option-value="staff"&gt;
    &lt;div class="form-group"&gt;
      &lt;%= form.label :university %&gt;
      &lt;%= form.select :university_id, options_for_select(University.all.map{ |uni| [uni.name, uni.id] }), {prompt: 'Select Your University'}, { class: "form-control" } %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the actual html:</p>
  
  <pre><code>&lt;div class="js-dependent-fields" data-select-id="user_role" data-option-value="staff"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="user_university"&gt;University&lt;/label&gt;
      &lt;select class="form-control" name="user[university_id]" id="user_university_id"&gt;&lt;option value=""&gt;Select Your University&lt;/option&gt;
  &lt;option value="1"&gt;Harvard&lt;/option&gt;&lt;/select&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Here is the error I'm getting:</p>
  
  <pre><code>  test_signup_valid_user                                         ERROR (0.05s)
  Capybara::ElementNotFound:         Capybara::ElementNotFound: Unable to find visible option "Harvard University"
              test/integration/boarding_flow_test.rb:63:in `block in &lt;class:BoardingFlowTest&gt;'
  </code></pre>
  
  <p>When the form is submitted, this is an example of what it passes as part of the parameters</p>
  
  <pre><code>"university_id"=&gt;"4"
  </code></pre>
  
  <p>In the below test I want to select a university, and I've tried every combination I can think of like:</p>
  
  <pre><code>page.select "3", from: "university_id"
  page.select "Harvard University", from: "University"
  </code></pre>
  
  <p>but I can't seem to get it to work. What is the proper way to do this? Thanks!</p>
  
  <pre><code>test 'signup valid user' do
      visit sign_up_path
  
      fill_in "First name", with: "John"
      fill_in "Last name", with: "Doe"
      fill_in "Email", with: "approved@doe.com"
      fill_in "Password", with: "foobar"
      page.select "Staff", from: "Role"
      page.select "3", from: "university_id"
  
      click_on "Signup"
  
      assert_equal sign_in_path, current_path
      assert page.has_content?("confirm your email")
    end
  </code></pre>
  
  <p><strong>Here is users/new.html.erb</strong></p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class="col-sm-8 col-md-4 col-sm-offset-2 col-md-offset-4"&gt;
      &lt;div class="login-panel panel panel-default"&gt;
        &lt;div class="panel-heading"&gt;
          &lt;h3 class="panel-title"&gt;Signup&lt;/h3&gt;
        &lt;/div&gt;
        &lt;div class="panel-body"&gt;
          &lt;%= form_for @user do |form| %&gt;
            &lt;fieldset&gt;
              &lt;%= render partial: '/users/form', object: form %&gt;
  
              &lt;%= form.submit t(".submit"), class: "btn btn-md btn-success btn-block" %&gt;
              &lt;hr&gt;
              &lt;h5 class="text-center"&gt;Already have an account?&lt;/h5&gt;
              &lt;%= link_to t(".login"), sign_in_path, class: "btn btn-md btn-info btn-block" %&gt;
            &lt;/fieldset&gt;
          &lt;% end %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Here's the form partial</strong></p>
  
  <pre><code>&lt;div class="form-group"&gt;
    &lt;%= form.label :first_name %&gt;
    &lt;%= form.text_field :first_name, class: "form-control" %&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;%= form.label :last_name %&gt;
    &lt;%= form.text_field :last_name, class: "form-control" %&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;%= form.label :email %&gt;
    &lt;%= form.text_field :email, type: 'email', class: "form-control" %&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;%= form.label :password %&gt;
    &lt;%= form.password_field :password, class: "form-control" %&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;%= form.label :role %&gt;
    &lt;%= form.select :role, options_for_select(User.roles.keys.map{ |role| [User.human_attribute_name("role.#{role}"), role] }), {}, { class: "form-control" } %&gt;
  &lt;/div&gt;
  
  &lt;div class="js-dependent-fields" data-select-id="user_role" data-option-value="staff"&gt;
    &lt;div class="form-group"&gt;
      &lt;%= form.label :university %&gt;
      &lt;%= form.select :university_id, options_for_select(University.all.map{ |uni| [uni.name, uni.id] }), {prompt: 'Select Your University'}, { class: "form-control" } %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>