Commit 4eb565791295d140b2d2fc930bde712547afa0cb
1 parent
88549694
Exists in
master
and in
29 other branches
Added test
(ActionItem2875)
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
app/views/cms/view.rhtml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | <% if !environment.enabled?('cant_change_homepage') && !remove_content_button(:home) %> | 5 | <% if !environment.enabled?('cant_change_homepage') && !remove_content_button(:home) %> |
6 | <div class="cms-homepage"> | 6 | <div class="cms-homepage"> |
7 | - <%= _('Profile Homepage:') %> | 7 | + <%= _('Profile homepage:') %> |
8 | <% if profile.home_page %> | 8 | <% if profile.home_page %> |
9 | <%= link_to_article(profile.home_page) %> | 9 | <%= link_to_article(profile.home_page) %> |
10 | <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %> | 10 | <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %> |
test/functional/cms_controller_test.rb
@@ -109,6 +109,18 @@ class CmsControllerTest < ActionController::TestCase | @@ -109,6 +109,18 @@ class CmsControllerTest < ActionController::TestCase | ||
109 | assert_no_tag :tag => 'a', :content => 'Use as homepage', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/set_home_page/#{folder.id}" } | 109 | assert_no_tag :tag => 'a', :content => 'Use as homepage', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/set_home_page/#{folder.id}" } |
110 | end | 110 | end |
111 | 111 | ||
112 | + should 'display the profile homepage if can change homepage' do | ||
113 | + env = Environment.default; env.disable('cant_change_homepage') | ||
114 | + get :index, :profile => profile.identifier | ||
115 | + assert_tag :tag => 'div', :content => /Profile homepage/, :attributes => { :class => "cms-homepage"} | ||
116 | + end | ||
117 | + | ||
118 | + should 'not display the profile homepage if cannot change homepage' do | ||
119 | + env = Environment.default; env.enable('cant_change_homepage') | ||
120 | + get :index, :profile => profile.identifier | ||
121 | + assert_no_tag :tag => 'div', :content => /Profile homepage/, :attributes => { :class => "cms-homepage"} | ||
122 | + end | ||
123 | + | ||
112 | should 'be able to set home page' do | 124 | should 'be able to set home page' do |
113 | a = profile.articles.build(:name => 'my new home page') | 125 | a = profile.articles.build(:name => 'my new home page') |
114 | a.save! | 126 | a.save! |