title: Why Rspec tests with javascript fails on CodeShip?
body: <p>I'm writing feature tests with: <code>ruby 2.1.4</code>, <code>rails 4.1.12</code>, <code>rspec (2.14.1)</code>, <code>capybara (2.4.1)</code> and <code>poltergeist (1.5.1)</code>.</p>
  
  <p>Currently I have a feature like this:</p>
  
  <pre><code>require 'spec_helper'
  
  feature 'user is able to import videos from YouTube Channel', js: true do
  
    before do
      @user = FactoryGirl.create :user
    end
  
    scenario 'from a simple correct YouTube video link' do
      VCR.use_cassette('video_sources/youtube_add_single_video') do
  
        visit root_path
  
        fill_in 'user_email',    with: @user.email
        fill_in 'user_password', with: @user.password
        click_button 'Log in'
  
        visit youtube_import_path
  
        expect(page).to have_css("input#query")
        expect(page).to have_css("a#continue-button")
  
        fill_in "query", with: "https://www.youtube.com/watch?v=xZY43QSx3Fk"
  
        page.find('#continue-button').trigger('click')
  
        # clicking on '#continue-button' call youtube API
        # receive a video data and store it into DB
  
        expect(page).to have_content("Congrats! Your import is complete")
      end
    end
  
  end
  </code></pre>
  
  <p>Locally  everything works fine, all tests are green.
  But on CodeShip - this scenario always fails.
  And I can not find a reason why...</p>
  
  <p>CodeShip log says that:</p>
  
  <pre><code>Capybara::Poltergeist::StatusFailError:
  Request to 'http://127.0.0.1:3000/' failed to reach server, check DNS and/or server status
  </code></pre>
  
  <p>But why? Locally all tests are green.</p>
  
  <p>P.S. I tried to add <code>sleep 5</code> before line <code>visit root_path</code> and it did not help.</p>
  
  <p>P.S.S. Maybe this part of <code>spec_helper.rb</code> will be helpful:</p>
  
  <pre><code>  config.before(:suite) do
      DatabaseCleaner.clean_with(:truncation)
      Capybara.reset_sessions!
    end
  
    config.before(:each) do
      DatabaseCleaner[:mongoid].start
    end
  
    config.after(:each) do
      DatabaseCleaner[:mongoid].clean
    end
  
    config.after(:suite) do
      Rails.cache.clear
    end
  </code></pre>