diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 461ba67..75b155b 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -147,8 +147,8 @@ class CmsController < MyProfileController article = params[:id].nil? ? nil : profile.articles.find(params[:id]) profile.update_attribute(:home_page, article) - if @article.nil? - session[:notice] = _('home page reseted.') + if article.nil? + session[:notice] = _('Homepage reseted.') else session[:notice] = _('"%s" configured as home page.') % article.name end diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index af64bbe..ef5e549 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -119,6 +119,7 @@ class CmsControllerTest < ActionController::TestCase profile.reload assert_equal a, profile.home_page + assert_match /configured/, session[:notice] end should 'be able to set home page even when profile description is invalid' do @@ -165,6 +166,7 @@ class CmsControllerTest < ActionController::TestCase profile.reload assert_equal nil, profile.home_page + assert_match /reseted/, session[:notice] end should 'display default home page' do -- libgit2 0.21.2