문제

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'
    require '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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top