Skip to content
Browse files

Switch to capybara-webkit

  • Loading branch information...
1 parent 8853ca7 commit 7fb2a8198e7f603911f28c5bb513d91c66e473c5 @mike-burns mike-burns committed with jyurek Jul 27, 2012
View
4 Gemfile.lock
@@ -60,6 +60,9 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
+ capybara-webkit (0.11.0)
+ capybara (>= 1.0.0, < 1.2)
+ json
childprocess (0.3.2)
ffi (~> 1.0.6)
cocaine (0.4.2)
@@ -190,6 +193,7 @@ DEPENDENCIES
bourne
bundler
capybara
+ capybara-webkit
cocaine (~> 0.2)
cucumber (~> 1.2.1)
fakeweb
View
5 features/step_definitions/rails_steps.rb
@@ -1,4 +1,8 @@
Given /^I generate a new rails application$/ do
+ in_current_dir do
+ FileUtils.rm_rf(APP_NAME)
+ end
+
steps %{
When I run `bundle exec #{new_application_command} #{APP_NAME} --skip-bundle`
And I cd to "#{APP_NAME}"
@@ -14,6 +18,7 @@
gem "gherkin"
gem "aws-sdk"
gem 'thin'
+ gem 'jquery-rails'
"""
And I configure the application to use "paperclip" from this project
And I reset Bundler environment variable
View
8 features/step_definitions/regnerating_styles_steps.rb
@@ -26,12 +26,14 @@ class User < ActiveRecord::Base
FakeWeb.allow_net_connect = true
in_current_dir { RailsServer.start_unless_started(ENV['PORT'], ENV['DEBUG']) }
- Capybara.current_driver = :selenium
+ require 'capybara/webkit'
+ Capybara.current_driver = :webkit
Capybara.app_host = RailsServer.app_host
visit '/users/new'
attach_file('Avatar', File.expand_path('test/fixtures/5k.png'))
click_button 'Submit'
+ sleep 1
end
When /^I add the following style to the user avatar:$/ do |string|
@@ -53,7 +55,7 @@ class User < ActiveRecord::Base
visit '/users'
click_link 'Show'
- page.source =~ %r{img src="/([^"]+large[^"]+)\?.*"}
+ page.source =~ %r{img.*src="/([^"]+large[^"]+)\?.*"}
image_path = $1
image_path.should_not be_blank
@@ -92,7 +94,7 @@ class #{migration_name.classify} < ActiveRecord::Migration
visit '/users'
click_link 'Show'
- page.source =~ %r{img src="/([^"]+large[^"]+)\?.*"}
+ page.source =~ %r{img.*src="/([^"]+large[^"]+)\?.*"}
image_path = $1
image_path.should_not be_blank
View
1 paperclip.gemspec
@@ -51,4 +51,5 @@ Gem::Specification.new do |s|
s.add_development_dependency('railties')
s.add_development_dependency('actionmailer')
s.add_development_dependency('thin')
+ s.add_development_dependency('capybara-webkit')
end

0 comments on commit 7fb2a81

Please sign in to comment.
Something went wrong with that request. Please try again.