Skip to content

Commit

Permalink
Fixes to cucumber features
Browse files Browse the repository at this point in the history
- Works with Rails 3.2.7
- Works with Heroku cedar (default ruby is 2.0)
  • Loading branch information
kmayer committed Jul 29, 2013
1 parent 449cdf8 commit 9b8db87
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions features/remote.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Feature: heroku_san can control a project on Heroku
Given I have a new Rails project
When I am in the project directory
And I commit any changes with "Initial commit"
And I add heroku_san to the Gemfile
And I add heroku_san to the rails Gemfile
And I run bundle install
And I generate a new config file
And I create my project on Heroku
Expand All @@ -35,7 +35,7 @@ Feature: heroku_san can control a project on Heroku
Given I have a new Sinatra project
When I am in the project directory
And I commit any changes with "Initial commit"
And I add heroku_san to the Gemfile
And I add heroku_san to the sinatra Gemfile
And I run bundle install
And I create a new config/heroku.yml file
And I create my project on Heroku
Expand Down
30 changes: 22 additions & 8 deletions features/step_definitions/remote_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'godot'

Given /^I have a new Rails project$/ do
cmd = "rails new test_app --quiet --force --skip-active-record --skip-bundle --skip-javascript --skip-test-unit --skip-sprockets"
cmd = "rails new test_app --quiet --force --skip-bundle --skip-javascript --skip-test-unit --skip-sprockets"
run_clean unescape(cmd)
end

Expand Down Expand Up @@ -51,8 +51,24 @@
run_clean "git tag -a '#{tag}' -m '#{annotation}' HEAD"
end

When /^I add heroku_san to the Gemfile$/ do
append_to_file 'Gemfile', <<EOT.strip_heredoc
When /^I add heroku_san to the rails Gemfile$/ do
overwrite_file 'Gemfile', <<EOT.strip_heredoc
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.7'
gem 'pg'
group :development, :test do
gem 'heroku_san', :path => '../../../.'
gem 'sqlite3'
end
EOT
end

When /^I add heroku_san to the sinatra Gemfile$/ do
overwrite_file 'Gemfile', <<EOT.strip_heredoc
source 'https://rubygems.org'
ruby '1.9.3'
gem 'sinatra'
group :development, :test do
gem 'heroku_san', :path => '../../../.'
end
Expand Down Expand Up @@ -142,7 +158,7 @@ def run_clean(cmd)
end

When /^I generate a scaffold$/ do
run_clean 'rails generate scaffold droid'
run_clean 'rails generate resource droid'
append_to_file 'app/views/droids/index.html.erb', %Q{\n<div><code><%= ENV['DROIDS'] -%></code></div>\n}
end

Expand Down Expand Up @@ -181,15 +197,13 @@ def run_clean(cmd)
test_app:
app: #{@app}
addons:
- deployhooks:campfire
- scheduler:standard
END_CONFIG

output = run_clean 'rake test_app heroku:addons'
# The output should show the new one ...
assert_partial_output "deployhooks:campfire", output
# ... with a note about needing to configure it.
assert_partial_output "https://api.heroku.com/myapps/#{@app}/addons/deployhooks:campfire", output
assert_partial_output "scheduler:standard", output
end

Then /^(?:heroku_san|issue \d+) (?:is green|has been fixed)$/ do
Expand Down

0 comments on commit 9b8db87

Please sign in to comment.