Skip to content

Commit

Permalink
update cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed Apr 30, 2010
1 parent b3d127a commit 5ef4e57
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -2,6 +2,7 @@

=== Edge

* Update to cucumber-rails 0.3.0 [Jim Gay]
* Update to Haml 2.2.24 [Jim Gay]

=== 0.9.0 RC2 (April 27, 2010)
Expand Down
6 changes: 3 additions & 3 deletions config/environments/cucumber.rb
Expand Up @@ -21,9 +21,9 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

config.gem 'cucumber-rails', :lib => false, :version => '>=0.2.4' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
config.gem 'database_cleaner', :lib => false, :version => '>=0.4.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
config.gem 'webrat', :lib => false, :version => '>=0.6.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
config.gem 'database_cleaner', :lib => false, :version => '>=0.5.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
config.gem 'webrat', :lib => false, :version => '>=0.7.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
config.gem 'rspec', :lib => false, :version => '>=1.3.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
config.gem 'rspec-rails', :lib => false, :version => '>=1.3.2' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))

16 changes: 13 additions & 3 deletions features/step_definitions/web_steps.rb
Expand Up @@ -250,11 +250,21 @@
end

Then /^(?:|I )should be on (.+)$/ do |page_name|
current_path = URI.parse(current_url).select(:path, :query).compact.join('?')
if defined?(Spec::Rails::Matchers)
current_path.should == path_to(page_name)
URI.parse(current_url).path.should == path_to(page_name)
else
assert_equal path_to(page_name), current_path
assert_equal path_to(page_name), URI.parse(current_url).path
end
end

Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
actual_params = CGI.parse(URI.parse(current_url).query)
expected_params = Hash[expected_pairs.rows_hash.map{|k,v| [k,[v]]}]

if defined?(Spec::Rails::Matchers)
actual_params.should == expected_params
else
assert_equal expected_params, actual_params
end
end

Expand Down
10 changes: 7 additions & 3 deletions features/support/env.rb
Expand Up @@ -49,6 +49,10 @@

# How to clean your database when transactions are turned off. See
# http://github.com/bmabey/database_cleaner for more info.
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation

if defined?(ActiveRecord::Base)
begin
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
rescue LoadError => ignore_if_database_cleaner_not_present
end
end
2 changes: 1 addition & 1 deletion lib/tasks/cucumber.rake
Expand Up @@ -7,7 +7,7 @@

unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks

vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?

begin
Expand Down

0 comments on commit 5ef4e57

Please sign in to comment.