开发者

Rails 3.1 capybara javascript test access denied

开发者 https://www.devze.com 2023-04-02 05:10 出处:网络
I\'ve just upgraded to Rails 3.1 and now when I try and run my cucumber (capybara) tests with the @javascript tag I get the following error:

I've just upgraded to Rails 3.1 and now when I try and run my cucumber (capybara) tests with the @javascript tag I get the following error:

The requested URL could not be retrieved
While trying to retrieve the URL: http://127.0.0.1:9987/login

The following error was encountered
    * Access Denied

I have the following defined in my features/support/env.rb file:

if defined?(ActiveRecord::Base)
  begin
    require 'database_cleaner'
    requ开发者_JAVA百科ire 'database_cleaner/cucumber'
    DatabaseCleaner.strategy = :truncation
  rescue LoadError => ignore_if_database_cleaner_not_present
  end
end

Capybara.server_port = 9987 + ENV['TEST_ENV_NUMBER'].to_i


Have you explicitly applied this server port to the Capybara.app_host?

Capybara.app_host = "http://dev.local:#{Capybara.server_port}"

Using this configuration I have no issues with current Rails 3.1 and capybara-webkit.

0

精彩评论

暂无评论...
验证码 换一张
取 消