Commit 6615319eef83594e166f11a49f1161ebf035d31a
Exists in
master
and in
27 other branches
Merge remote-tracking branch 'origin/master'
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 |