Skip to content

Commit

Permalink
Ensure to seed before each test run.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas von Deyen committed Nov 19, 2014
1 parent a2b1c30 commit 7df8f01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ end
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

require 'rspec/core'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)
Expand All @@ -32,7 +31,7 @@ namespace :alchemy do

desc "Prepares database for testing Alchemy"
task :prepare do
system 'cd spec/dummy && RAILS_ENV=test bundle exec rake db:migrate:reset alchemy:db:seed && cd -'
system 'cd spec/dummy && RAILS_ENV=test bundle exec rake db:migrate:reset && cd -'
end

end
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
require "rspec/rails"
require "capybara/rails"
require 'factory_girl'
require 'alchemy/seeder'
require 'alchemy/test_support/auth_helpers'
require 'alchemy/test_support/controller_requests'
require 'alchemy/test_support/integration_helpers'
Expand All @@ -37,4 +38,7 @@
config.include Alchemy::TestSupport::IntegrationHelpers, :type => :feature
config.include Alchemy::Engine.routes.url_helpers
config.include FactoryGirl::Syntax::Methods
config.before(:suite) do
Alchemy::Seeder.seed!
end
end

0 comments on commit 7df8f01

Please sign in to comment.