title: Rspec + phantomjs/poltergeist GITLAB CI fails to run integration/feature
body: <p>Hi I am struggling to run my integration/feature tests via the Ci, please do let me know what am I doing wrong here.</p>
  
  <p>Running specs locally works without any issues</p>
  
  <p>The strangeness of this is that it dose not want to run because it seems to have problems finding application .css or .js </p>
  
  <p>the gitlab CI setup :</p>
  
  <pre><code>image: ruby:2.3.0
  
  cache:
  paths:
  - .bundle
  - vendor/
  
  stages:
   - test
   - integration
   - codecov
  
  before_script:
   - export COMPILE=0
   - export PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
   - export RAILS_ENV=test
   - gem install bundler
   - bundle install --path vendor/
   - mkdir ~/tmp
   - pushd ~/tmp
   - wget --max-redirect=40 
     http://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
   - tar xf $PHANTOM_JS.tar.bz2
   - mv $PHANTOM_JS phantomjs
   - ln -s ~/tmp/phantomjs/bin/phantomjs /usr/bin/phantomjs
   - phantomjs --version
   - popd
  rspec:
    stage: test
    services:
      - postgres:latest
      - redis:latest
  variables:
      POSTGRES_DB: package_analysis_test
      POSTGRES_USER: runner
      POSTGRES_PASSWORD: runner
  
    script:
      - apt-get update -qq &amp;&amp; apt-get install -y -qq nodejs postgresql-
        client libpq-dev
      - gem install bundler --no-ri --no-rdoc
      - cp config/_database.yml config/database.yml
      - cp config/_redis.yml config/redis.yml
      - cp config/_sidekiq.yml config/sidekiq.yml
      - cp config/_settings.yml config/settings.yml
      - bundle exec rake db:drop RAILS_ENV=test
      - bundle exec rake db:create RAILS_ENV=test
      - bundle exec rake db:schema:load RAILS_ENV=test
      - bundle exec rake db:structure:load RAILS_ENV=test
      - bundle exec rake db:seed RAILS_ENV=test
      - bundle exec rake assets:precompile RAILS_ENV=test
      - bundle exec rspec --exclude-pattern spec/features/*_spec.rb
    artifacts:
      paths:
        - coverage/
  
  rspec-integration:
    stage: integration
    services:
      - postgres:latest
      - redis:latest
    variables:
      POSTGRES_DB: package_analysis_test
      POSTGRES_USER: runner
      POSTGRES_PASSWORD: runner
  
    script:
      - apt-get update -qq &amp;&amp; apt-get install -y -qq nodejs postgresql-
        client libpq-dev
      - gem install bundler --no-ri --no-rdoc
      - cp config/_database.yml config/database.yml
      - cp config/_redis.yml config/redis.yml
      - cp config/_sidekiq.yml config/sidekiq.yml
      - cp config/_settings.yml config/settings.yml
      - bundle exec rake db:drop RAILS_ENV=test
      - bundle exec rake db:create RAILS_ENV=test
      - bundle exec rake db:schema:load RAILS_ENV=test
      - bundle exec rake db:structure:load RAILS_ENV=test
      - bundle exec rake db:seed RAILS_ENV=test
      - bundle exec rake assets:precompile RAILS_ENV=test
      - bundle exec rspec spec/features
  pages:
    stage: codecov
    dependencies:
      - rspec
    script:
      - mv coverage/ public/
    artifacts:
      paths:
        - public
      expire_in: 30 days
    only:
      - staging
  </code></pre>
  
  <p>this is how the 'head' of the error looks like: </p>
  
  <pre><code>1) User processes late orders entering late orders #index
     Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #
    {env['PATH_INFO'].inspect}"
  
      ActionController::RoutingError:
       No route matches [GET] "/assets/application.css"
       # /builds/justcode/packageanalysis/vendor/ruby/2.3.0/gems/web-console-
     2.0.0/lib/action_dispatch/debug_exceptions.rb:22:in `middleware_call'
      # /builds/justcode/packageanalysis/vendor/ruby/2.3.0/gems/web-console-
    2.0.0/lib/action_dispatch/debug_exceptions.rb:13:in `call'
     # /builds/justcode/packageanalysis/vendor/ruby/2.3.0/gems/actionpack-
     4.2.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
      # /builds/justcode/packageanalysis/vendor/ruby/2.3.0/gems/railties-4.2.5/lib/rails/rack/logger.rb:38:in 
     `call_app'
  </code></pre>
  
  <p>Once its the application js the other tie its the css file. I am confused on what to do with this </p>
  
  <p>this is also my capybara setup from the test helpers : </p>
  
  <pre><code>require 'capybara/rspec'
  require 'capybara/poltergeist'
  require 'capybara/rails'
  
  Capybara.register_driver :poltergeist do |app|
    options = {
      js_errors: true,
      cookies: true,
      inspector: true,
      window_size: [2_500, 2_500]
    }
    Capybara::Poltergeist::Driver.new(app, options)
  end
  
  Capybara.default_driver = :poltergeist
  Capybara.javascript_driver = :poltergeist
  Capybara.default_selector = :css
  </code></pre>