Commit dc115f261b0131d0487b034e08eef385b5eb01eb

Authored by Antonio Terceiro
1 parent d4df1561

Adjust multitenancy test for different PostgreSQL versions

test/functional/application_controller_test.rb
... ... @@ -486,8 +486,11 @@ class ApplicationControllerTest < ActionController::TestCase
486 486 Noosfero::MultiTenancy.expects(:mapping).returns({ 'schema1.com' => 'schema1' }).at_least_once
487 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 494 end
492 495  
493 496 should 'not change postgresql schema if multitenancy is off' do
... ...