Sha256: e558b25c876234fcc13bf49d0535f04cdaa70b1327ad1aea4287022b52cac630

Contents?: true

Size: 1.53 KB

Versions: 8

Compression:

Stored size: 1.53 KB

Contents

run 'rails generate rspec:install'
run 'rails generate cucumber:install --capybara --rspec'
run 'rails generate pickle --email'

inject_into_file 'config/application.rb', :after => "# Configure the default encoding used in templates for Ruby 1.9.\n" do
<<-RUBY
    config.generators do |g|
      g.test_framework :rspec
    end
RUBY
end

inject_into_file 'features/support/env.rb', :after => "ENV[\"RAILS_ENV\"] ||= \"test\"\n" do 
<<-RUBY
$VERBOSE = nil
RUBY
end

gsub_file 'features/support/env.rb',/require 'cucumber\/rails\/capybara_javascript_emulation'/,'#require \'cucumber/rails/capybara_javascript_emulation\''

run 'mkdir spec/factories'

create_file 'features/step_definitions/web_steps_extended.rb' do
<<-'FILE'
When /^I confirm a js popup on the next step$/ do
  page.evaluate_script("window.alert = function(msg) { return true; }")
  page.evaluate_script("window.confirm = function(msg) { return true; }")
end

When /^I perform the following actions:$/ do |table|
  table.hashes.each do |row|
    case row['Action']
    when 'Fill in'
      Given "I fill in \"#{row['Field']}\" with \"#{row['Value']}\""
    when 'Check'
      if row['Value'] =~ /true/
        Given "I check \"#{row['Field']}\""
      else
        Given "I uncheck \"#{row['Field']}\""
      end
    when 'Choose'
      Given "I choose \"#{row['Field']}\""
    end
  end
end
FILE
end

create_file 'features/step_definitions/factory_steps.rb' do
<<-'FILE'
Given /^the following (.+) records?$/ do |factory, table|
  table.hashes.each do |hash|
    Factory(factory, hash)
  end
end
FILE
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
prologue-0.6.0 templates/default/lib/test_suite.rb
prologue-0.5.5 templates/test_suite.rb
prologue-0.5.0 templates/test_suite.rb
prologue-0.4.0 templates/test_suite.rb
prologue-0.3.11 templates/test_suite.rb
prologue-0.3.10 templates/test_suite.rb
prologue-0.3.9 templates/test_suite.rb
prologue-0.3.7 templates/test_suite.rb