Sha256: 66ba1b107e48e6979e3ec00fac19ff9404cf2b5cf6ae01878a1d51d686e1298e

Contents?: true

Size: 1.74 KB

Versions: 7

Compression:

Stored size: 1.74 KB

Contents

# Application template recipe for the rails_apps_composer. Change the recipe here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/tests.rb

stage_two do
  say_wizard "recipe stage two"
  if prefer :tests, 'rspec'
    say_wizard "recipe installing RSpec"
    generate 'testing:configure rspec -f'
  end
  if prefer :continuous_testing, 'guard'
    say_wizard "recipe initializing Guard"
    run 'bundle exec guard init'
  end
  git :add => '-A' if prefer :git, true
  git :commit => '-qm "rails_apps_composer: testing framework"' if prefer :git, true
end

stage_three do
  say_wizard "recipe stage three"
  if (prefer :authentication, 'devise') && (prefer :tests, 'rspec')
    generate 'testing:configure devise -f'
    if (prefer :devise_modules, 'confirmable') || (prefer :devise_modules, 'invitable')
      inject_into_file 'spec/factories/users.rb', '    confirmed_at Time.now', :after => 'factory :user do'
      default_url = '  config.action_mailer.default_url_options = { :host => Rails.application.secrets.domain_name }'
      inject_into_file 'config/environments/test.rb', default_url, :after => "delivery_method = :test\n"
      gsub_file 'spec/features/users/user_edit_spec.rb', /successfully./, 'successfully,'
      gsub_file 'spec/features/visitors/sign_up_spec.rb', /Welcome! You have signed up successfully./, 'A message with a confirmation'
    end
  end
  if (prefer :authentication, 'omniauth') && (prefer :tests, 'rspec')
    generate 'testing:configure omniauth -f'
  end
  if (prefer :authorization, 'pundit') && (prefer :tests, 'rspec')
    generate 'testing:configure pundit -f'
  end
end

__END__

name: tests
description: "Add testing framework."
author: RailsApps

requires: [setup, gems]
run_after: [setup, gems]
category: testing

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_apps_composer-3.0.10 recipes/tests.rb
rails_apps_composer-3.0.9 recipes/tests.rb
rails_apps_composer-3.0.8 recipes/tests.rb
rails_apps_composer-3.0.7 recipes/tests.rb
rails_apps_composer-3.0.6 recipes/tests.rb
rails_apps_composer-3.0.5 recipes/tests.rb
rails_apps_composer-3.0.4 recipes/tests.rb