Commit 614b0d244c162dbed1c6bed3220b5667458f4133
1 parent
0767edbc
Exists in
master
and in
19 other branches
ApplicationControllerTest: adapt multitenancy test
It turns out that in the version of PostgreSQL in Debian Jessie, setting a search path to an unexisting schema does not produce an error (while it did in the version in Wheezy)
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
test/functional/application_controller_test.rb
| @@ -485,7 +485,9 @@ class ApplicationControllerTest < ActionController::TestCase | @@ -485,7 +485,9 @@ class ApplicationControllerTest < ActionController::TestCase | ||
| 485 | Noosfero::MultiTenancy.expects(:on?).returns(true) | 485 | Noosfero::MultiTenancy.expects(:on?).returns(true) |
| 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 | - assert_match /SET search_path TO schema1/, exception.message | 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 | end | 491 | end |
| 490 | 492 | ||
| 491 | should 'not change postgresql schema if multitenancy is off' do | 493 | should 'not change postgresql schema if multitenancy is off' do |