Commit 0da263565bd1eb370f230426a55ca5acb1c1b4b6
1 parent
067cd84b
Exists in
master
and in
21 other branches
guarantee main block is always visible to everybody
Showing
3 changed files
with
18 additions
and
0 deletions
Show diff stats
app/models/main_block.rb
| @@ -24,4 +24,10 @@ class MainBlock < Block | @@ -24,4 +24,10 @@ class MainBlock < Block | ||
| 24 | ['always', 'except_home_page'] | 24 | ['always', 'except_home_page'] |
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | + def display_user_options | ||
| 28 | + @display_user_options = { | ||
| 29 | + 'all' => _('All users') | ||
| 30 | + } | ||
| 31 | + end | ||
| 32 | + | ||
| 27 | end | 33 | end |
test/functional/profile_design_controller_test.rb
| @@ -755,4 +755,12 @@ class ProfileDesignControllerTest < ActionController::TestCase | @@ -755,4 +755,12 @@ class ProfileDesignControllerTest < ActionController::TestCase | ||
| 755 | assert_response :forbidden | 755 | assert_response :forbidden |
| 756 | end | 756 | end |
| 757 | 757 | ||
| 758 | + should 'guarantee main block is always visible to everybody' do | ||
| 759 | + get :edit, :profile => 'designtestuser', :id => @b4.id | ||
| 760 | + %w[logged not_logged followers].each do |option| | ||
| 761 | + assert_no_tag :select, :attributes => {:name => 'block[display_user]'}, | ||
| 762 | + :descendant => {:tag => 'option', :attributes => {:value => option}} | ||
| 763 | + end | ||
| 764 | + end | ||
| 765 | + | ||
| 758 | end | 766 | end |
test/unit/main_block_test.rb
| @@ -29,4 +29,8 @@ class MainBlockTest < ActiveSupport::TestCase | @@ -29,4 +29,8 @@ class MainBlockTest < ActiveSupport::TestCase | ||
| 29 | assert !block.visible? | 29 | assert !block.visible? |
| 30 | end | 30 | end |
| 31 | 31 | ||
| 32 | + should 'guarantee main block is always visible to everybody' do | ||
| 33 | + assert_equal MainBlock.new.display_user_options, {"all"=>_('All users')} | ||
| 34 | + end | ||
| 35 | + | ||
| 32 | end | 36 | end |