Skip to content
This repository
Browse code

Switch to capybara-webkit

  • Loading branch information...
commit 41eeb4f0630d1f0cf02e3e55a53022b8309c4ed0 1 parent ab750eb
Mike Burns mike-burns authored
4 Gemfile.lock
@@ -60,6 +60,9 @@ GEM
60 60 rack-test (>= 0.5.4)
61 61 selenium-webdriver (~> 2.0)
62 62 xpath (~> 0.1.4)
  63 + capybara-webkit (0.11.0)
  64 + capybara (>= 1.0.0, < 1.2)
  65 + json
63 66 childprocess (0.3.2)
64 67 ffi (~> 1.0.6)
65 68 cocaine (0.2.1)
@@ -190,6 +193,7 @@ DEPENDENCIES
190 193 bourne
191 194 bundler
192 195 capybara
  196 + capybara-webkit
193 197 cocaine (~> 0.2)
194 198 cucumber (~> 1.2.1)
195 199 fakeweb
5 features/step_definitions/rails_steps.rb
... ... @@ -1,4 +1,8 @@
1 1 Given /^I generate a new rails application$/ do
  2 + in_current_dir do
  3 + FileUtils.rm_rf(APP_NAME)
  4 + end
  5 +
2 6 steps %{
3 7 When I run `bundle exec #{new_application_command} #{APP_NAME} --skip-bundle`
4 8 And I cd to "#{APP_NAME}"
@@ -14,6 +18,7 @@
14 18 gem "gherkin"
15 19 gem "aws-sdk"
16 20 gem 'thin'
  21 + gem 'jquery-rails'
17 22 """
18 23 And I configure the application to use "paperclip" from this project
19 24 And I reset Bundler environment variable
8 features/step_definitions/regnerating_styles_steps.rb
@@ -26,12 +26,14 @@ class User < ActiveRecord::Base
26 26 FakeWeb.allow_net_connect = true
27 27 in_current_dir { RailsServer.start_unless_started(ENV['PORT'], ENV['DEBUG']) }
28 28
29   - Capybara.current_driver = :selenium
  29 + require 'capybara/webkit'
  30 + Capybara.current_driver = :webkit
30 31 Capybara.app_host = RailsServer.app_host
31 32
32 33 visit '/users/new'
33 34 attach_file('Avatar', File.expand_path('test/fixtures/5k.png'))
34 35 click_button 'Submit'
  36 + sleep 1
35 37 end
36 38
37 39 When /^I add the following style to the user avatar:$/ do |string|
@@ -53,7 +55,7 @@ class User < ActiveRecord::Base
53 55 visit '/users'
54 56 click_link 'Show'
55 57
56   - page.source =~ %r{img src="/([^"]+large[^"]+)\?.*"}
  58 + page.source =~ %r{img.*src="/([^"]+large[^"]+)\?.*"}
57 59 image_path = $1
58 60 image_path.should_not be_blank
59 61
@@ -92,7 +94,7 @@ class #{migration_name.classify} < ActiveRecord::Migration
92 94 visit '/users'
93 95 click_link 'Show'
94 96
95   - page.source =~ %r{img src="/([^"]+large[^"]+)\?.*"}
  97 + page.source =~ %r{img.*src="/([^"]+large[^"]+)\?.*"}
96 98 image_path = $1
97 99 image_path.should_not be_blank
98 100
1  paperclip.gemspec
@@ -51,4 +51,5 @@ Gem::Specification.new do |s|
51 51 s.add_development_dependency('railties')
52 52 s.add_development_dependency('actionmailer')
53 53 s.add_development_dependency('thin')
  54 + s.add_development_dependency('capybara-webkit')
54 55 end

0 comments on commit 41eeb4f

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