From 4eb565791295d140b2d2fc930bde712547afa0cb Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Mon, 25 Nov 2013 12:15:59 +0000 Subject: [PATCH] Added test --- app/views/cms/view.rhtml | 2 +- test/functional/cms_controller_test.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/cms/view.rhtml b/app/views/cms/view.rhtml index 8697b95..adba5fa 100644 --- a/app/views/cms/view.rhtml +++ b/app/views/cms/view.rhtml @@ -4,7 +4,7 @@ <% if !environment.enabled?('cant_change_homepage') && !remove_content_button(:home) %>
- <%= _('Profile Homepage:') %> + <%= _('Profile homepage:') %> <% if profile.home_page %> <%= link_to_article(profile.home_page) %> <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %> diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index ef5e549..5b0fb39 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -109,6 +109,18 @@ class CmsControllerTest < ActionController::TestCase assert_no_tag :tag => 'a', :content => 'Use as homepage', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/set_home_page/#{folder.id}" } end + should 'display the profile homepage if can change homepage' do + env = Environment.default; env.disable('cant_change_homepage') + get :index, :profile => profile.identifier + assert_tag :tag => 'div', :content => /Profile homepage/, :attributes => { :class => "cms-homepage"} + end + + should 'not display the profile homepage if cannot change homepage' do + env = Environment.default; env.enable('cant_change_homepage') + get :index, :profile => profile.identifier + assert_no_tag :tag => 'div', :content => /Profile homepage/, :attributes => { :class => "cms-homepage"} + end + should 'be able to set home page' do a = profile.articles.build(:name => 'my new home page') a.save! -- libgit2 0.21.2