Permalink
Browse files

Refactor: delete bobbins

  • Loading branch information...
1 parent 738ab6b commit 73687defec307517d845620c276d379dc218c9a3 @mattwynne mattwynne committed Nov 2, 2011
Showing with 11 additions and 45 deletions.
  1. +1 −1 features/routing.feature
  2. +10 −44 features/step_definitions/cucumber_rails_steps.rb
View
@@ -1,7 +1,7 @@
Feature: Routing
Scenario: Visit undefined route
- Given a project without ActiveRecord
+ Given I have created a new Rails 3 app with cucumber-rails support but no database
And I remove the file "public/index.html"
And I write to "features/tests.feature" with:
"""
@@ -1,6 +1,6 @@
module RailsHelper
- def rails_new(app_name)
- run_simple "rails new #{app_name} --skip-bundle --skip-test-unit"
+ def rails_new(app_name, options = '')
+ run_simple "rails new #{app_name} --skip-bundle --skip-test-unit #{options}"
assert_passing_with('README')
cd app_name
end
@@ -50,50 +50,16 @@ def append_to_gemfile(content)
end
end
-Given /^a project without ActiveRecord$/ do
- steps %Q{
- Given I successfully run `rails new cuke-app`
- And I cd to "cuke-app"
- And I append to "Gemfile" with:
- """
- gem "cucumber-rails", :group => :test, :path => "#{File.expand_path('.')}"
- gem "capybara", :group => :test
- gem "rspec-rails", :group => :test
-
- """
- And I successfully run `bundle exec rails generate cucumber:install`
- And I overwrite "features/support/env.rb" with:
- """
- require 'cucumber/rails'
-
- """
-
- And I write to "config/application.rb" with:
- """
- require File.expand_path('../boot', __FILE__)
-
- require 'action_controller/railtie'
- require 'action_mailer/railtie'
- require 'active_resource/railtie'
- require 'rails/test_unit/railtie'
-
- Bundler.require(:default, Rails.env) if defined?(Bundler)
-
- module CukeApp
- class Application < Rails::Application
- config.encoding = "utf-8"
- config.filter_parameters += [:password]
- end
- end
-
- """
- And I remove the file "config/database.yml"
+Given /^I have created a new Rails 3 app with cucumber\-rails support but no database$/ do
+ rails_new 'rails-3-app', '--skip-active-record'
+ append_to_gemfile %{
+gem "cucumber-rails", :group => :test, :path => "#{File.expand_path('.')}"
+gem "capybara", :group => :test
+gem "rspec-rails", :group => :test
}
+ install_cucumber_rails
+ overwrite_file('features/support/env.rb', "require 'cucumber/rails'\n")
create_web_steps
- if(ENV['ARUBA_REPORT_DIR'])
- @aruba_report_start = Time.new
- sleep(1)
- end
end
Given /^a cukes resource$/ do

0 comments on commit 73687de

Please sign in to comment.