Permalink
Browse files

I do not care what your rails app is called

  • Loading branch information...
1 parent 73687de commit 346a33841ed491c0fc358fbd104206c0ee37ad46 @mattwynne mattwynne committed Nov 2, 2011
@@ -1,7 +1,7 @@
Feature: Allow Cucumber to rescue exceptions
Background: A controller that raises an exception
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And I write to "app/controllers/posts_controller.rb" with:
"""
class PostsController < ApplicationController
@@ -1,7 +1,7 @@
Feature: Capybara Javascript Drivers
Background: A simple calendar app
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And I successfully run `bundle exec rails g scaffold appointment name:string when:datetime`
And I write to "features/step_definitions/date_time_steps.rb" with:
"""
@@ -1,7 +1,7 @@
Feature: DatabaseCleaner
Scenario: Create records in background
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And I write to "features/widgets.feature" with:
"""
Feature: Create widgets
@@ -5,7 +5,7 @@ Feature: Fixing Bundler Pre
@bundler-pre
Scenario: Install Cucumber-Rails with bundler prerelease
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support and cucumber-rails is outside of test group
+ Given I have created a new Rails 3 app and installed cucumber-rails, accidentally outside of the test group in my Gemfile
And I successfully run `rake db:migrate`
And I write to "features/tests.feature" with:
"""
@@ -1,7 +1,7 @@
Feature: Inspect query string
Scenario: Inspect query string
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And I successfully run `rails generate scaffold cuke name:string`
And I overwrite "app/controllers/cukes_controller.rb" with:
"""
@@ -4,7 +4,7 @@ Feature: Rails 3
of Rails 3 and Ruby, with Capybara, Spork and DatabaseCleaner
Scenario: Install Cucumber-Rails
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
Then the following files should exist:
| config/cucumber.yml |
| script/cucumber |
@@ -4,7 +4,7 @@ Feature: Multiple Databases
I want to specify explicit strategies for each
Background: A Rails 3 app utilizing multiple database repositories exists
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And I append to "config/database.yml" with:
"""
@@ -2,7 +2,7 @@ Feature: No Database
Allow Cucumber to work with a Rails app without a database
Scenario: No ActiveRecord and DatabaseCleaner
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
# Turn off ActiveRecord
And I write to "config/application.rb" with:
"""
@@ -4,7 +4,7 @@ Feature: Rerun profile
I want to rerun only failing features
Scenario: Rerun
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And a file named "rerun.txt" with:
"""
features/rerun_test.feature:2
@@ -1,7 +1,7 @@
Feature: REST API
Scenario: Compare JSON
- Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
+ Given I have created a new Rails 3 app and installed cucumber-rails
And I write to "app/controllers/posts_controller.rb" with:
"""
class PostsController < ApplicationController
@@ -1,5 +1,6 @@
module RailsHelper
- def rails_new(app_name, options = '')
+ def rails_new(options = '')
+ app_name = 'test_app'
run_simple "rails new #{app_name} --skip-bundle --skip-test-unit #{options}"
assert_passing_with('README')
cd app_name
@@ -15,8 +16,8 @@ def append_to_gemfile(content)
end
World(RailsHelper)
-Given /^I have created a new Rails 3 app "([^"]*)" with cucumber\-rails support and cucumber-rails is outside of test group$/ do |app_name|
- rails_new app_name
+Given /^I have created a new Rails 3 app and installed cucumber\-rails, accidentally outside of the test group in my Gemfile$/ do
+ rails_new
append_to_gemfile %{
gem "cucumber-rails", :path => "#{File.expand_path('.')}"
gem "capybara", :group => :test
@@ -32,8 +33,8 @@ def append_to_gemfile(content)
end
end
-Given /^I have created a new Rails 3 app "([^"]*)" with cucumber\-rails support$/ do |app_name|
- rails_new app_name
+Given /^I have created a new Rails 3 app with cucumber\-rails support$/ do
+ rails_new
append_to_gemfile %{
gem "cucumber-rails", :group => :test, :path => "#{File.expand_path('.')}"
gem "capybara", :group => :test
@@ -51,7 +52,7 @@ def append_to_gemfile(content)
end
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'
+ rails_new '--skip-active-record'
append_to_gemfile %{
gem "cucumber-rails", :group => :test, :path => "#{File.expand_path('.')}"
gem "capybara", :group => :test
@@ -83,15 +84,11 @@ def index
end
Before('@bundler-pre') do
- steps %Q{
- Given I successfully run `gem uninstall bundler`
- And I successfully run `gem install bundler --pre`
- }
+ run_simple 'gem uninstall bundler'
+ run_simple 'gem install bundler --pre'
end
After('@bundler-pre') do
- steps %Q{
- Given I successfully run `gem uninstall bundler`
- And I successfully run `gem install bundler`
- }
+ run_simple 'gem uninstall bundler'
+ run_simple 'gem install bundler'
end

0 comments on commit 346a338

Please sign in to comment.