From f9837747f6fafeeac442253fc76094d9a9c155f6 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 30 Mar 2020 10:59:11 +0200 Subject: [PATCH] fix running tests --- scripts/run-tests.sh | 8 ++++---- test/integration/abuses_test.rb | 2 ++ test/models/price_category_test.rb | 2 +- test/test_helper.rb | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 95245152a..ee14217e4 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash RAILS_ENV='test' bin/rails db:environment:set -RAILS_ENV='test' rake db:drop -RAILS_ENV='test' rake db:create -RAILS_ENV='test' rake db:migrate -RAILS_ENV='test' bundle exec rake test "$@" +RAILS_ENV='test' bin/rails db:drop +RAILS_ENV='test' bin/rails db:create +RAILS_ENV='test' bin/rails db:migrate +RAILS_ENV='test' bundle exec bin/rails test "$@" diff --git a/test/integration/abuses_test.rb b/test/integration/abuses_test.rb index 030145105..ed417032f 100644 --- a/test/integration/abuses_test.rb +++ b/test/integration/abuses_test.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'test_helper' + class AbusesTest < ActionDispatch::IntegrationTest # Called before every test method runs. Can be used # to set up fixture information. diff --git a/test/models/price_category_test.rb b/test/models/price_category_test.rb index 374b6a916..a41deaf46 100644 --- a/test/models/price_category_test.rb +++ b/test/models/price_category_test.rb @@ -2,7 +2,7 @@ require 'test_helper' class PriceCategoryTest < ActiveSupport::TestCase test 'price category name must be unique' do - pc = PriceCategory.new({name: '- DE 25 ANS', conditions: 'Tarif préférentiel pour les jeunes'}) + pc = PriceCategory.new(name: '- DE 25 ANS', conditions: 'Tarif préférentiel pour les jeunes') assert pc.invalid? assert pc.errors[:name].present? end diff --git a/test/test_helper.rb b/test/test_helper.rb index d1111775d..1258a3558 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -5,6 +5,7 @@ Coveralls.wear!('rails') ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../config/environment', __dir__) +require 'action_dispatch' require 'rails/test_help' require 'vcr' require 'sidekiq/testing'