From 2e9bff75949eba9a354245a79f412bcaa6486c19 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Thu, 25 Oct 2012 13:50:21 -0200 Subject: [PATCH] Fixed broken tests --- app/controllers/public/profile_controller.rb | 2 +- test/functional/application_controller_test.rb | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 20352af..9ee1ea0 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -264,7 +264,7 @@ class ProfileController < PublicController def profile_info begin - @block = profile.blocks.find(params[:block_id]).includes(:box) + @block = profile.blocks.find(params[:block_id]) rescue render :text => _('Profile information could not be loaded') end diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 776ffd0..382ee10 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -296,15 +296,20 @@ class ApplicationControllerTest < ActionController::TestCase should 'not display invisible blocks' do @controller.expects(:uses_design_blocks?).returns(true) - p = create_user_full('test_user').person + p = create_user('test_user').person @controller.expects(:profile).at_least_once.returns(p) - b = p.blocks[1] - b.expects(:visible?).returns(false) - b.save! - get :index, :profile => p.identifier + box = p.boxes.first + invisible_block = fast_create(Block, :box_id => box.id) + invisible_block.display = 'never' + invisible_block.save + visible_block = fast_create(Block, :box_id => box.id) + visible_block.display = 'always' + visible_block.save - assert_no_tag :tag => 'div', :attributes => {:id => 'block-' + b.id.to_s} + get :index, :profile => p.identifier + assert_no_tag :tag => 'div', :attributes => {:id => 'block-' + invisible_block.id.to_s} + assert_tag :tag => 'div', :attributes => {:id => 'block-' + visible_block.id.to_s} end should 'diplay name of environment in description' do -- libgit2 0.21.2