Capybara tests with :js=>true… Routing Error: No route matches [GET] “/assets”

前端 未结 4 2256
忘掉有多难
忘掉有多难 2020-12-08 02:14

I\'m getting a similar error in a number of tests when I add \":js => true\" to them. eg:

    An error occurred in an after hook
      ActionController::Rout         


        
4条回答
  •  轮回少年
    2020-12-08 02:43

    In my case, the default missing image was set to point to s3. I didn't really care if the image was loaded or not. PhantomJs has an option to disable image loading via the command line arg --load-images=no.

    In Poltergeist, this can be setup when registering the driver:

    Capybara.register_driver :poltergeist do |app| Capybara::Poltergeist::Driver.new(app, :phantomjs_options => ['--load-images=no']) end

提交回复
热议问题