Commit 6c01c1762400d1ae7fa76fd70ee59aad8142b5d1
1 parent
3f27e6f1
Exists in
master
and in
29 other branches
Fixed: message on notice after configure homepage
(ActionItem2875)
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
... | ... | @@ -147,8 +147,8 @@ class CmsController < MyProfileController |
147 | 147 | article = params[:id].nil? ? nil : profile.articles.find(params[:id]) |
148 | 148 | profile.update_attribute(:home_page, article) |
149 | 149 | |
150 | - if @article.nil? | |
151 | - session[:notice] = _('home page reseted.') | |
150 | + if article.nil? | |
151 | + session[:notice] = _('Homepage reseted.') | |
152 | 152 | else |
153 | 153 | session[:notice] = _('"%s" configured as home page.') % article.name |
154 | 154 | end | ... | ... |
test/functional/cms_controller_test.rb
... | ... | @@ -119,6 +119,7 @@ class CmsControllerTest < ActionController::TestCase |
119 | 119 | |
120 | 120 | profile.reload |
121 | 121 | assert_equal a, profile.home_page |
122 | + assert_match /configured/, session[:notice] | |
122 | 123 | end |
123 | 124 | |
124 | 125 | should 'be able to set home page even when profile description is invalid' do |
... | ... | @@ -165,6 +166,7 @@ class CmsControllerTest < ActionController::TestCase |
165 | 166 | |
166 | 167 | profile.reload |
167 | 168 | assert_equal nil, profile.home_page |
169 | + assert_match /reseted/, session[:notice] | |
168 | 170 | end |
169 | 171 | |
170 | 172 | should 'display default home page' do | ... | ... |