From 3a441cd7d98d14e1523e9589eac258c464dcd604 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sun, 24 Feb 2013 18:46:31 +1100 Subject: [PATCH] Configure travis for postgres --- .travis.yml | 10 ++++++++-- config/database.travis.yml | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 config/database.travis.yml diff --git a/.travis.yml b/.travis.yml index ff8309032b..11874106e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,11 @@ language: ruby bundler_args: --without development rvm: - "1.9.3" -# uncomment this line if your project needs to run something other than `rake`: -script: bundle exec rspec spec \ No newline at end of file +services: postgresql +before_script: + - cp config/database.travis.yml config/database.yml + - psql -c 'create database open_food_web_test;' -U postgres +script: + - RAILS_ENV=test bundle exec rake db:migrate --trace + - bundle exec rake db:test:prepare + - bundle exec rspec spec diff --git a/config/database.travis.yml b/config/database.travis.yml new file mode 100644 index 0000000000..712a914658 --- /dev/null +++ b/config/database.travis.yml @@ -0,0 +1,4 @@ +test: + adapter: postgresql + database: open_food_web_test + username: postgres