diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 40507974a..bc161ba9f 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -313,6 +313,7 @@ class Invoice < ActiveRecord::Base end def log_changes + return if Rails.env.test? return unless changed? puts "WARNING: Invoice update triggered [ id: #{id}, reference: #{reference} ]" diff --git a/app/models/invoice_item.rb b/app/models/invoice_item.rb index 54e6511a2..724b7271f 100644 --- a/app/models/invoice_item.rb +++ b/app/models/invoice_item.rb @@ -35,6 +35,7 @@ class InvoiceItem < ActiveRecord::Base end def log_changes + return if Rails.env.test? return unless changed? puts "WARNING: InvoiceItem update triggered [ id: #{id}, invoice reference: #{invoice.reference} ]" diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh new file mode 100644 index 000000000..70c1b69f5 --- /dev/null +++ b/scripts/run-tests.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +RAILS_ENV=test rake db:drop +RAILS_ENV=test rake db:create +RAILS_ENV=test rake db:migrate +rake test diff --git a/test/fixtures/reservations.yml b/test/fixtures/reservations.yml index 7d456a425..bf7800cee 100644 --- a/test/fixtures/reservations.yml +++ b/test/fixtures/reservations.yml @@ -7,7 +7,6 @@ reservation_1: updated_at: 2012-03-12 11:03:31.651441000 Z reservable_id: 2 reservable_type: Training - stp_invoice_id: nb_reserve_places: reservation_2: @@ -18,5 +17,4 @@ reservation_2: updated_at: 2015-06-10 11:20:01.341130000 Z reservable_id: 4 reservable_type: Machine - stp_invoice_id: nb_reserve_places: