从登台服务器运行测试rails phantomjs

时间:2014-05-08 23:11:49

标签: ruby-on-rails-4 capybara integration-testing phantomjs poltergeist

当我设置管理测试用户界面时,我有一个rails应用程序,因此我们的测试团队可以输入标准并通过测试套件运行动态标准。

我有一个cron作业,检查等待运行的排队测试,然后通过capybara和poltergeist / phantomjs一次运行一个

这适用于我的本地开发机器在开发环境中,但是当我将它部署到远程服务器上的登台环境时,它找不到任何资产,即js,css和图像。

查看来源,看起来它试图从http://127.0.0.1:3000/assets获取这些问题。

我尝试将asset_host更改为与暂存环境相同但似乎没有更改它。

任何人都可以帮忙吗?

这是我的test.rb env文件

MyApp::Application.configure do

  config.session_store :redis_store, :key => 'staging'

  # Settings specified here will take precedence over those in config/application.rb

  # The test environment is used exclusively to run your application's
  # test suite. You never need to work with it otherwise. Remember that
  # your test database is "scratch space" for the test suite and is wiped
  # and recreated between test runs. Don't rely on the data there!
  config.cache_classes = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = false

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = true

  # Generate digests for assets URLs
  config.assets.digest = true

  # Log error messages when you accidentally call methods on nil
  #config.whiny_nils = true

  config.eager_load = false

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  # Raise exceptions instead of rendering exception templates
  config.action_dispatch.show_exceptions = false

  # Disable request forgery protection in test environment
  config.action_controller.allow_forgery_protection    = false

  # Tell Action Mailer not to deliver emails to the real world.
  # The :test delivery method accumulates sent emails in the
  # ActionMailer::Base.deliveries array.
  config.action_mailer.delivery_method = :test

  # Raise exception on mass assignment protection for Active Record models
  config.active_record.mass_assignment_sanitizer = :strict

  # Print deprecation notices to the stderr
  config.active_support.deprecation = :stderr

  config.action_controller.asset_host = "http://dev1.domain.com/staging"
end

0 个答案:

没有答案