我应该使用Selenium还是Jasmine来测试RSpec的视图文件?

我正在使用Ruby on Rails 3.2.2,cucumber-rails-1.3.0,rspec-rails-2.8.1和capybara-1.1.2以及Selenium驱动程序。 在收到我之前的问题的答案后,我有一个疑问: 我应该使用Selenium ruby​​-gem还是Jasmine ruby​​-gem来测试RSpec的视图文件? 如果是这样,因为我已经使用Selenium来测试JavaScript用于Cucumber的视图文件, 为什么 (当使用RSpec测试时)我应该使用Jasmine而不是Selenium? 也就是说,为什么要使用两个具有相同目的并制造相同东西的ruby?

一般而言,实际上, 您如何建议使用RSpec测试视图文件? …但是,它是使用RSpec测试视图文件的“正确方法”还是应该使用Cucumber测试?

我更喜欢使用selenium服务器,firefox中的selenium IDE和rspec的selenium客户端。

selenium_helper.rb

ENV["RAILS_ENV"] ||= 'test' require File.expand_path(File.join(File.dirname(__FILE__),'../..','config','environment')) require 'spec/autorun' require 'spec/rails' require 'factory_girl' require 'rspec/instafail' require "selenium/client" Spec::Runner.configure do |config| end 

rspec_tester_file_spec.rb

  require "selenium/selenium_helper" require "selenium/modules/loginator" describe "tester" do attr_reader :selenium_driver alias :page :selenium_driver before(:all) do @verification_errors = [] @selenium_driver = Selenium::Client::Driver.new \ :host => "localhost", :port => 4444, :browser => "*firefox", :url => "http://localhost:3000", :timeout_in_second => 60 end before(:each) do @selenium_driver.start_new_browser_session end append_after(:each) do @selenium_driver.close_current_browser_session end it "login and then try to search for stuff" do @login.run_login(page) page.click "link=CSR" page.wait_for_page_to_load "30000" page.type "id=isq_Name", "john smith" page.click "css=input[type=\"submit\"]" page.wait_for_page_to_load "30000" page.is_text_present("Update") page.is_text_present("Date") page.is_text_present("PIN") page.is_text_present("Name") end