From: <nul...@cl...> - 2011-08-26 23:52:56
|
SHIBATA Hiroshi 2011-08-26 23:25:06 +0000 (Fri, 26 Aug 2011) New Revision: 87ea39d84f22ca5f2e73ea9c5c7fb8edee026f4f Log: added javascript testing framework(capybara-webkit and jasmine) Modified files: Gemfile Gemfile.lock spec/acceptance_helper.rb Modified: Gemfile (+6 -3) =================================================================== --- Gemfile 2011-08-25 11:37:41 +0000 (e262000) +++ Gemfile 2011-08-26 23:25:06 +0000 (e46a8e0) @@ -12,11 +12,14 @@ end group :test do gem 'rspec' gem 'fuubar' + + gem 'jasmine' + gem 'rcov', :platforms => :mri_18 gem 'cover_me', :platforms => :mri_19 + gem 'nokogiri', '~> 1.4.7' # for ruby-1.8.6 - gem 'steak' - gem 'capybara', :require => 'capybara/rspec' - gem 'capybara-mechanize', :require => 'capybara/mechanize' + gem 'capybara-webkit' + gem 'capybara-mechanize', '~> 0.3.0.rc2', :require => 'capybara/mechanize' gem 'launchy' end Modified: Gemfile.lock (+15 -14) =================================================================== --- Gemfile.lock 2011-08-25 11:37:41 +0000 (32d5ca4) +++ Gemfile.lock 2011-08-26 23:25:06 +0000 (4ff0038) @@ -8,19 +8,18 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.1.0) - capybara (0.4.1.2) - celerity (>= 0.7.9) - culerity (>= 0.2.4) + capybara (1.0.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) - selenium-webdriver (>= 0.0.27) - xpath (~> 0.1.3) - capybara-mechanize (0.2.7) - capybara (~> 0.4.0) + selenium-webdriver (~> 2.0) + xpath (~> 0.1.4) + capybara-mechanize (0.3.0.rc2) + capybara (~> 1.0.0) mechanize (~> 1.0.0) - celerity (0.9.0) + capybara-webkit (0.6.1) + capybara (~> 1.0.0) childprocess (0.2.1) ffi (~> 1.0.6) configatron (2.8.2) @@ -28,7 +27,6 @@ GEM cover_me (1.1.2) configatron hashie - culerity (0.2.15) daemons (1.1.4) diff-lcs (1.1.2) eventmachine (0.12.10) @@ -40,6 +38,11 @@ GEM ruby-progressbar (~> 0.0.10) hashie (1.1.0) highline (1.6.2) + jasmine (1.0.2.1) + json_pure (>= 1.4.3) + rack (>= 1.1) + rspec (>= 1.3.1) + selenium-webdriver (>= 0.1.3) json_pure (1.5.3) launchy (2.0.5) addressable (~> 2.2.6) @@ -78,8 +81,6 @@ GEM ffi (>= 1.0.7) json_pure rubyzip - steak (1.1.0) - rspec (>= 1.3) thin (1.2.11) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -95,10 +96,11 @@ PLATFORMS DEPENDENCIES capistrano - capybara - capybara-mechanize + capybara-mechanize (~> 0.3.0.rc2) + capybara-webkit cover_me fuubar + jasmine launchy nokogiri (~> 1.4.7) pit @@ -106,5 +108,4 @@ DEPENDENCIES rake rcov rspec - steak thin Modified: spec/acceptance_helper.rb (+9 -1) =================================================================== --- spec/acceptance_helper.rb 2011-08-25 11:37:41 +0000 (ce25816) +++ spec/acceptance_helper.rb 2011-08-26 23:25:06 +0000 (0086896) @@ -1,4 +1,5 @@ require 'spec_helper' +require 'capybara/rspec' Dir["#{File.dirname(__FILE__)}/acceptance/support/**/*.rb"].each {|f| require f} @@ -28,12 +29,19 @@ end if ENV['CGI_TEST'] Capybara.default_driver = :mechanize + Capybara.app_host = 'http://localhost:19292' + RSpec.configuration.filter_run_excluding :mechanize => true else require 'tdiary/application' - Capybara.default_driver = :rack_test + Capybara.default_driver = :webkit + Capybara.app = Rack::Builder.new do + use Rack::Reloader + use Rack::Static, :urls => ["/theme"], :root => "." + use Rack::Static, :urls => ["/js"], :root => "." + map '/' do run TDiary::Application.new(:index) end |