어떻게 rspec 작업 레일 3 에 대한 통합 테스트?
-
22-09-2019 - |
문제
무엇을 하려고 해요 ahieve 이지 통합 테스트를 webrat 에 rails3 다음과 같다가스 테스트-단위 http://pivotallabs.com/talks/76-extending-rails-3 분 34.
예를 들어:
describe SomeApp
it "should show the index page"
visit "/"
body.should =~ /hello world/
end
end
는 누군가가 알고있는 그것을 할 수있는 방법?
해결책
Have you tried using rspec-rails: http://github.com/rspec/rspec-rails
That is the repository (install instructions in the Readme) for the new RSpec 2.0 which will work with Rails 3.
다른 팁
thoughtbot 다만 블로그 게시물을 게시합니다.
안정성에 문제가 될 수 있습 웹 응용 프로그램으로 진화하고 성장할 수 있는 통합 테스트를 제공하는 훌륭한 방법으로 수행하는 end-to-end 는 테스트를 확인 응용 프로그램을 수행하으로 예상된다.
Support for Rails 3 is coming in rSpec 2, apparently.
ceck this link now it is very simple tu use rspec with rails3 http://github.com/rspec/rspec-rails and you don't need to run script/generate rspec_scaffold like in rails 2.x.x, now you just run rails g scaffold and it will generate the rspec files