2016-06-20 2 views
0

capybara에서로드 된 페이지를 가져올 수없는 것으로 보입니다. 응용 프로그램은 localhost:3000/secure 아래에 이름 공간이 있지만 거기에 대한 모든 설정이 적절하다고 생각합니다. 나는 카피 바라가 서버 로그를 치는 것을보고, 정상적으로 페이지를로드하고 상태 200을 리턴하는 것처럼 보입니다. 그러나 페이지를 볼 때 출력은 항상 빈 HTML 페이지와 같습니다.Capybara 방문시 페이지가로드되지 않습니다.

서버 오류 (500 및 404)를 표시하는 데 사용됩니다. 내가 컨트롤러 사람들을 고정하지만 일단 아무 일도 발생하지 않습니다

RSpec에 :

html로의
it 'should update the record normally for married status' do 
    visit edit_members_bene_partner_path 
    save_and_open_page 
end 

출력은 다음과 같습니다

<html><head></head><body></body></html> 

RSpec에 도우미 :

# This file is copied to spec/ when you run 'rails generate rspec:install' 
ENV['RAILS_ENV'] ||= 'test' 
require File.expand_path('../../config/environment', __FILE__) 
require 'rspec/rails' 
require 'capybara/rspec' 
require 'capybara/rails' 
require 'capybara/poltergeist' 
require 'capybara-screenshot/rspec' 
require 'factory_girl_rails' 

# settings for capybara 
Capybara.configure do |config| 
    config.javascript_driver = :poltergeist 
    config.default_wait_time = 5 
    config.app_host = 'localhost:3000/secure' 
    config.run_server = true 
end 

RSpec.configure do |config| 
    config.include Capybara::DSL 
    config.include FactoryGirl::Syntax::Methods 
    config.include Rails.application.routes.url_helpers 
end 
+0

호스트 (http : //)에 프로토콜을 포함 시키거나 디렉토리 이름을 방문 단계로 이동 시키려고 했습니까? – Godwin

+0

@ Godwin 그게 해결되었을 수도 있습니다! 나는 몇 가지 시험을 더 실시 할 것이다. – Ruslan

답변

0

@Godwin로 카피 바라의 config.app_host에게 'http : //'를 추가하여 제안 된 문제를 해결했습니다

관련 문제