diff --git a/app/models/main_block.rb b/app/models/main_block.rb index a834c11..0ed3650 100644 --- a/app/models/main_block.rb +++ b/app/models/main_block.rb @@ -24,4 +24,10 @@ class MainBlock < Block ['always', 'except_home_page'] end + def display_user_options + @display_user_options = { + 'all' => _('All users') + } + end + end diff --git a/test/functional/profile_design_controller_test.rb b/test/functional/profile_design_controller_test.rb index b0dde3d..bbe55ac 100644 --- a/test/functional/profile_design_controller_test.rb +++ b/test/functional/profile_design_controller_test.rb @@ -755,4 +755,12 @@ class ProfileDesignControllerTest < ActionController::TestCase assert_response :forbidden end + should 'guarantee main block is always visible to everybody' do + get :edit, :profile => 'designtestuser', :id => @b4.id + %w[logged not_logged followers].each do |option| + assert_no_tag :select, :attributes => {:name => 'block[display_user]'}, + :descendant => {:tag => 'option', :attributes => {:value => option}} + end + end + end diff --git a/test/unit/main_block_test.rb b/test/unit/main_block_test.rb index ce2c18d..1124416 100644 --- a/test/unit/main_block_test.rb +++ b/test/unit/main_block_test.rb @@ -29,4 +29,8 @@ class MainBlockTest < ActiveSupport::TestCase assert !block.visible? end + should 'guarantee main block is always visible to everybody' do + assert_equal MainBlock.new.display_user_options, {"all"=>_('All users')} + end + end -- libgit2 0.21.2