From dc115f261b0131d0487b034e08eef385b5eb01eb Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 1 Dec 2015 21:55:23 -0200 Subject: [PATCH] Adjust multitenancy test for different PostgreSQL versions --- test/functional/application_controller_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 76df1bb..5a4d504 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -486,8 +486,11 @@ class ApplicationControllerTest < ActionController::TestCase Noosfero::MultiTenancy.expects(:mapping).returns({ 'schema1.com' => 'schema1' }).at_least_once exception = assert_raise(ActiveRecord::StatementInvalid) { get :index } - # we have switched to a new database schema, and whatever table we need don't exist in it - assert_match /PG::UndefinedTable/, exception.message + # we have switched to a new database schema; depending on the PostgreSQL + # version, we will receive either an error message because the schema + # does not exist, or an error saying that whatever table we need can't be + # found. + assert_match /(SET search_path TO schema1|PG::UndefinedTable)/, exception.message end should 'not change postgresql schema if multitenancy is off' do -- libgit2 0.21.2