1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

do not display invoice update logs in test mode + updated reservations fixtures w/o stp_invoice_id column + helper script to run tests

This commit is contained in:
Sylvain 2019-09-11 14:29:35 +02:00
parent 9fc3c7f61c
commit 78e6392f60
4 changed files with 8 additions and 2 deletions

View File

@ -313,6 +313,7 @@ class Invoice < ActiveRecord::Base
end end
def log_changes def log_changes
return if Rails.env.test?
return unless changed? return unless changed?
puts "WARNING: Invoice update triggered [ id: #{id}, reference: #{reference} ]" puts "WARNING: Invoice update triggered [ id: #{id}, reference: #{reference} ]"

View File

@ -35,6 +35,7 @@ class InvoiceItem < ActiveRecord::Base
end end
def log_changes def log_changes
return if Rails.env.test?
return unless changed? return unless changed?
puts "WARNING: InvoiceItem update triggered [ id: #{id}, invoice reference: #{invoice.reference} ]" puts "WARNING: InvoiceItem update triggered [ id: #{id}, invoice reference: #{invoice.reference} ]"

6
scripts/run-tests.sh Normal file
View File

@ -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

View File

@ -7,7 +7,6 @@ reservation_1:
updated_at: 2012-03-12 11:03:31.651441000 Z updated_at: 2012-03-12 11:03:31.651441000 Z
reservable_id: 2 reservable_id: 2
reservable_type: Training reservable_type: Training
stp_invoice_id:
nb_reserve_places: nb_reserve_places:
reservation_2: reservation_2:
@ -18,5 +17,4 @@ reservation_2:
updated_at: 2015-06-10 11:20:01.341130000 Z updated_at: 2015-06-10 11:20:01.341130000 Z
reservable_id: 4 reservable_id: 4
reservable_type: Machine reservable_type: Machine
stp_invoice_id:
nb_reserve_places: nb_reserve_places: