[Git][noosfero/noosfero][master] 2 commits: ApplicationControllerTest: adapt multitenancy test

Antonio Terceiro gitlab at mg.gitlab.com
Tue Dec 1 18:48:01 BRST 2015


Antonio Terceiro pushed to branch master at Noosfero / noosfero


Commits:
614b0d24 by Antonio Terceiro at 2015-12-01T18:14:32Z
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)

- - - - -
d4df1561 by Antonio Terceiro at 2015-12-01T18:27:37Z
ProfileControllerTest: fix pagination test

This does not seem to be a problem with packages from Rubygems, but with
Debian packages we need this workaround for the test to work.

- - - - -


2 changed files:

- test/functional/application_controller_test.rb
- test/functional/profile_controller_test.rb


Changes:

=====================================
test/functional/application_controller_test.rb
=====================================
--- a/test/functional/application_controller_test.rb
+++ b/test/functional/application_controller_test.rb
@@ -485,7 +485,9 @@ class ApplicationControllerTest < ActionController::TestCase
       Noosfero::MultiTenancy.expects(:on?).returns(true)
       Noosfero::MultiTenancy.expects(:mapping).returns({ 'schema1.com' => 'schema1' }).at_least_once
       exception = assert_raise(ActiveRecord::StatementInvalid) { get :index }
-      assert_match /SET search_path TO schema1/, exception.message
+
+      # we have switched to a new database schema, and whatever table we need don't exist in it
+      assert_match /PG::UndefinedTable/, exception.message
     end
 
     should 'not change postgresql schema if multitenancy is off' do


=====================================
test/functional/profile_controller_test.rb
=====================================
--- a/test/functional/profile_controller_test.rb
+++ b/test/functional/profile_controller_test.rb
@@ -873,11 +873,11 @@ class ProfileControllerTest < ActionController::TestCase
     assert_template 'index'
   end
 
-  should 'the network activity be paginated on communities' do
+  should 'paginate the network activity listing on communities' do
     community = fast_create(Community)
     40.times{ fast_create(ActionTrackerNotification, :profile_id => community.id, :action_tracker_id => fast_create(ActionTracker::Record, :user_id => profile.id)) }
     get :index, :profile => community.identifier
-    assert_equal 15, assigns(:network_activities).size
+    assert_equal 15, assigns(:network_activities).to_a.size
   end
 
   should 'the self activity not crashes with user not logged in' do



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/0767edbc0a44f14c8e945073cd23e626c7c36de0...d4df15613e5525a01acddc12ac0c7e9c12de5ff9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151201/b05cf6a6/attachment.html>


More information about the Noosfero-dev mailing list