Created
April 2, 2011 12:47
-
-
Save LBRapid/899470 to your computer and use it in GitHub Desktop.
Spree flag_extensions example rake test_app task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Regenerates a rails 3 app for testing" | |
task :test_app do | |
SPREE_PATH = ENV['SPREE_PATH'] | |
raise "SPREE_PATH should be specified" unless SPREE_PATH | |
require File.join(SPREE_PATH, 'lib/generators/spree/test_app_generator') | |
class FlagPromotionTestAppGenerator < Spree::Generators::TestAppGenerator | |
def tweak_gemfile | |
append_file 'Gemfile' do | |
<<-gems | |
gem 'spree_core', :path => '#{File.join(SPREE_PATH, 'core')}' | |
gem 'flag_promotions', :path => '#{File.dirname(__FILE__)}' | |
gems | |
end | |
end | |
def migrate_db | |
run_migrations | |
end | |
def install_gems | |
inside "test_app" do | |
run 'bundle install' | |
run 'rake spree_core:install' | |
end | |
end | |
end | |
FlagPromotionTestAppGenerator.start | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment