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,8 +147,8 @@ class CmsController < MyProfileController | ||
147 | article = params[:id].nil? ? nil : profile.articles.find(params[:id]) | 147 | article = params[:id].nil? ? nil : profile.articles.find(params[:id]) |
148 | profile.update_attribute(:home_page, article) | 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 | else | 152 | else |
153 | session[:notice] = _('"%s" configured as home page.') % article.name | 153 | session[:notice] = _('"%s" configured as home page.') % article.name |
154 | end | 154 | end |
test/functional/cms_controller_test.rb
@@ -119,6 +119,7 @@ class CmsControllerTest < ActionController::TestCase | @@ -119,6 +119,7 @@ class CmsControllerTest < ActionController::TestCase | ||
119 | 119 | ||
120 | profile.reload | 120 | profile.reload |
121 | assert_equal a, profile.home_page | 121 | assert_equal a, profile.home_page |
122 | + assert_match /configured/, session[:notice] | ||
122 | end | 123 | end |
123 | 124 | ||
124 | should 'be able to set home page even when profile description is invalid' do | 125 | should 'be able to set home page even when profile description is invalid' do |
@@ -165,6 +166,7 @@ class CmsControllerTest < ActionController::TestCase | @@ -165,6 +166,7 @@ class CmsControllerTest < ActionController::TestCase | ||
165 | 166 | ||
166 | profile.reload | 167 | profile.reload |
167 | assert_equal nil, profile.home_page | 168 | assert_equal nil, profile.home_page |
169 | + assert_match /reseted/, session[:notice] | ||
168 | end | 170 | end |
169 | 171 | ||
170 | should 'display default home page' do | 172 | should 'display default home page' do |