Commit dc115f261b0131d0487b034e08eef385b5eb01eb
1 parent
d4df1561
Exists in
master
and in
19 other branches
Adjust multitenancy test for different PostgreSQL versions
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
test/functional/application_controller_test.rb
@@ -486,8 +486,11 @@ class ApplicationControllerTest < ActionController::TestCase | @@ -486,8 +486,11 @@ class ApplicationControllerTest < ActionController::TestCase | ||
486 | Noosfero::MultiTenancy.expects(:mapping).returns({ 'schema1.com' => 'schema1' }).at_least_once | 486 | Noosfero::MultiTenancy.expects(:mapping).returns({ 'schema1.com' => 'schema1' }).at_least_once |
487 | exception = assert_raise(ActiveRecord::StatementInvalid) { get :index } | 487 | exception = assert_raise(ActiveRecord::StatementInvalid) { get :index } |
488 | 488 | ||
489 | - # we have switched to a new database schema, and whatever table we need don't exist in it | ||
490 | - assert_match /PG::UndefinedTable/, exception.message | 489 | + # we have switched to a new database schema; depending on the PostgreSQL |
490 | + # version, we will receive either an error message because the schema | ||
491 | + # does not exist, or an error saying that whatever table we need can't be | ||
492 | + # found. | ||
493 | + assert_match /(SET search_path TO schema1|PG::UndefinedTable)/, exception.message | ||
491 | end | 494 | end |
492 | 495 | ||
493 | should 'not change postgresql schema if multitenancy is off' do | 496 | should 'not change postgresql schema if multitenancy is off' do |