From 8a4841d6b71a25c5c83130c357eeae31d02b8174 Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Tue, 9 Jun 2015 17:01:25 +0000 Subject: [PATCH] Fix functional and integration broken tests --- test/functional/application_controller_test.rb | 2 +- test/functional/profile_controller_test.rb | 10 +++++++--- test/integration/routing_test.rb | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 1a99752..c6737d9 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -484,7 +484,7 @@ class ApplicationControllerTest < ActionController::TestCase should 'change postgresql schema' do uses_host 'schema1.com' Noosfero::MultiTenancy.expects(:on?).returns(true) - Noosfero::MultiTenancy.expects(:mapping).returns({ 'schema1.com' => 'schema1' }) + 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 end diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index f1bcdd7..5f4a779 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -508,11 +508,15 @@ class ProfileControllerTest < ActionController::TestCase end should 'show description of person' do + environment = Environment.default + environment.custom_person_fields = {:description => { :active => true, :required => false, :signup => false }} + environment.save! + environment.reload login_as(@profile.identifier) - @profile.description = 'Person\'s description' - @profile.save + @profile.description = 'Person description' + @profile.save! get :index, :profile => @profile.identifier - assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Person\'s description/ + assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Person description/ end should 'not show description of orgarnization if not filled' do diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 1c57323..f32f3fa 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -135,7 +135,7 @@ class RoutingTest < ActionController::IntegrationTest end def test_assets_routing - assert_routing('/assets/my-asset/a/b/c', :controller => 'search', :action => 'assets', :asset => 'my-asset', :category_path => 'a/b/c') + assert_routing('/search/assets/a/b/c', :controller => 'search', :action => 'assets', :category_path => 'a/b/c') end def test_content_view_with_dot -- libgit2 0.21.2