title: Testing datepicker gem with Rspec
body: <p>I am using the bootstrap-datepicker-rails gem for my app and have created a form where users can pick a start date and an end date. </p>
  
  <p>When the user edits the form I want them to be able to see the dates that they had previously chosen. (e.g. Start: October 31, 2015, End: November 15, 2015).</p>
  
  <p>I am trying to write a test to make sure my app does this, but I'm stuck on the syntax.</p>
  
  <p><strong>user_updates_project_spec.rb</strong></p>
  
  <pre><code>require "rails_helper"
  
  feature "User updates project" do
     before (:each) do
        @user = create(:user)
        login_as(@user, scope: :user)
        @project = create(:project, creator: @user,
                    name: "Building a robot",
                    start_at: "2015-10-31",
                    end_at: "2015-11-15", )
     end
  
    scenario "and sees correct dates on form" do
       visit edit_user_project_path(@user, @project)
  
       expect(".datepicker").to have_content("October 31, 2015")
     end
  end
  </code></pre>
  
  <p>The error I get is: </p>
  
  <pre><code>Failure/Error: expect(".datepicker").to have_content("October 31, 2015")
    expected to find text "October 31, 2015" in ".datepicker"
  </code></pre>
  
  <p>This is what my form looks like: </p>
  
  <pre><code>&lt;div class="col-sm-6 pl0"&gt;
     &lt;%= f.input :start_at, label: "Start Date", as: :string,
                    input_html: {value:@project.set_start_date_for_form.to_s(:long),
                    class: "datepicker start-date"} %&gt;
  &lt;/div&gt;
  &lt;div class="col-sm-6 pr0"&gt;
     &lt;%= f.input :end_at, label: "End Date", as: :string,
                    input_html: {value: @project.set_end_date_for_form.to_s(:long),
                    class: "datepicker end-date"} %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Any ideas on why it's not working? </p>