Ruby on rails 4 从暂存服务器rails phantomjs运行测试
我有一个rails应用程序,当我设置了管理员测试UI时,我们的测试团队可以输入标准并通过测试套件运行动态标准 我有一个cron任务,它检查排队等待运行的测试,然后通过水豚和poltergeist/phantomjs一次运行一个测试 这在dev环境中的本地开发机器上工作,但当我将其部署到远程服务器上的暂存环境时,它找不到任何资产,即js、css和图像 从源代码看,它似乎试图从Ruby on rails 4 从暂存服务器rails phantomjs运行测试,ruby-on-rails-4,capybara,integration-testing,phantomjs,poltergeist,Ruby On Rails 4,Capybara,Integration Testing,Phantomjs,Poltergeist,我有一个rails应用程序,当我设置了管理员测试UI时,我们的测试团队可以输入标准并通过测试套件运行动态标准 我有一个cron任务,它检查排队等待运行的测试,然后通过水豚和poltergeist/phantomjs一次运行一个测试 这在dev环境中的本地开发机器上工作,但当我将其部署到远程服务器上的暂存环境时,它找不到任何资产,即js、css和图像 从源代码看,它似乎试图从http://127.0.0.1:3000/assets这就是问题所在 我曾尝试将asset_主机更改为与暂存环境相同,但似
http://127.0.0.1:3000/assets
这就是问题所在
我曾尝试将asset_主机更改为与暂存环境相同,但似乎没有更改它
有人能帮忙吗
这是我的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
你能再清楚一点你的架构吗?当您将应用程序部署到staging时,您是使用RAILS_ENV=production部署应用程序,但使用RAILS_ENV=test运行cron作业,还是其他什么?相关的