나는 rspec으로 작성된 컨트롤러/뷰 테스트를 결합한 묶음이있다. 카피 바라 보석을 추가하고 잘 통과하는 통합 테스트를 작성했습니다.Capybara 설치 후 컨트롤러 테스트가 끊어 졌습니까?
NoMethodError:
undefined method `has_selector?' for #<ActionController::TestResponse:0xa03e7ec>
내가 컨트롤러를 실행하면 유일한 문제는 지금은
response.should의 have_selector ("어떤 선택을")이 내 모든 컨트롤러 테스트에
RSpec에 같은 오류를 준다이다 테스트. Capybara가 컨트롤러 테스트에서 사용되고 있고 일부 Rspec 메서드를 덮어 쓰고있는 것 같습니다. 이 문제를 어떻게 해결할 수 있습니까?
# gemfile.rb
group :test do
gem 'rspec'
gem "capybara"
gem "launchy"
gem 'factory_girl_rails', '1.0'
end
# spec_helper.rb
RSpec.configure do |config|
config.include IntegrationSpecHelper, :type => :request
end
는 여기 실패한 테스트의 예 :
# spec/controllers/books_controller_spec.rb
require 'spec_helper'
describe BooksController do
render_views
it "should have the right page title" do
get :show, :id => @book.ean
response.should have_selector("title", :content => "Lexicase | " + @book.title)
end
end
과 오류 연관된 : 당신은 아마 이전 Webrat을 사용하고
1) BooksController GET 'show' should have the right page title
Failure/Error: response.should have_selector("title", :content => "Lexicase | " + @book.title)
NoMethodError:
undefined method `has_selector?' for #<ActionController::TestResponse:0xa8488c0>
# ./spec/controllers/books_controller_spec.rb:23:in `block (3 levels) in <top (required)>'
실패한 테스트를 추가 할 수 있습니까? – shingara
원래 게시물을 업데이트했습니다. –