From 59d132f89ba26037b620069c61ba186f477f702a Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Fri, 2 May 2014 16:49:16 -0300 Subject: [PATCH] Remove disabled enterprise message --- app/views/content_viewer/view_page.rhtml | 2 -- app/views/profile/index.rhtml | 2 -- app/views/shared/_disabled_enterprise.rhtml | 10 ---------- test/functional/profile_controller_test.rb | 28 ++-------------------------- 4 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 app/views/shared/_disabled_enterprise.rhtml diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml index a64a1d5..0b30aec 100644 --- a/app/views/content_viewer/view_page.rhtml +++ b/app/views/content_viewer/view_page.rhtml @@ -40,8 +40,6 @@ <% end %> -<%= render :partial => 'shared/disabled_enterprise' %> - <% if NOOSFERO_CONF['addthis_enabled'] %> <%= render :partial => 'addthis' %> <% end %> diff --git a/app/views/profile/index.rhtml b/app/views/profile/index.rhtml index c53054c..ba54b90 100644 --- a/app/views/profile/index.rhtml +++ b/app/views/profile/index.rhtml @@ -1,5 +1,3 @@ -<%= render :partial => 'shared/disabled_enterprise' %> -

<%= h profile.name %>

<% if @action %> diff --git a/app/views/shared/_disabled_enterprise.rhtml b/app/views/shared/_disabled_enterprise.rhtml deleted file mode 100644 index aa6f177..0000000 --- a/app/views/shared/_disabled_enterprise.rhtml +++ /dev/null @@ -1,10 +0,0 @@ -<% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %> -
- <%= environment.message_for_disabled_enterprise %> - <% if profile.blocked? && user && user.is_admin?(profile.environment) %> -
- <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %> -
- <% end %> -
-<% end %> diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index eac86e3..16a78da 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -230,30 +230,6 @@ class ProfileControllerTest < ActionController::TestCase assert_no_match /Add friend/, @response.body end - should 'show message for disabled enterprise' do - login_as(@profile.identifier) - ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false) - get :index, :profile => ent.identifier - assert_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => /#{Environment.default.message_for_disabled_enterprise}/ - end - - should 'not show message for disabled enterprise to non-enterprises' do - login_as(@profile.identifier) - @profile.enabled = false; @profile.save! - get :index, :profile => @profile.identifier - assert_no_tag :tag => 'div', :attributes => { :id => 'profile-disabled' }, :content => Environment.default.message_for_disabled_enterprise - end - - should 'not show message for disabled enterprise if there is a block for it' do - login_as(@profile.identifier) - ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false) - ent.boxes << Box.new - ent.boxes[0].blocks << DisabledEnterpriseMessageBlock.new - ent.save - get :index, :profile => ent.identifier - assert_no_tag :tag => 'div', :attributes => {:class => 'blocks'}, :descendant => { :tag => 'div', :attributes => { :id => 'profile-disabled' }} - end - should 'display "Products" link for enterprise' do ent = fast_create(Enterprise, :name => 'my test enterprise', :identifier => 'my-test-enterprise', :enabled => false) @@ -1189,7 +1165,7 @@ class ProfileControllerTest < ActionController::TestCase 20.times {comment = fast_create(Comment, :source_id => article, :title => 'a comment', :body => 'lalala', :created_at => Time.now)} article.reload get :index, :profile => profile.identifier - assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments'}, :children => {:count => 0 } + assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments'}, :children => {:count => 0 } end should "view more comments paginated" do @@ -1215,7 +1191,7 @@ class ProfileControllerTest < ActionController::TestCase 20.times {fast_create(Scrap, :sender_id => profile.id, :receiver_id => profile.id, :scrap_id => scrap.id)} profile.reload get :index, :profile => profile.identifier - assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments scrap-replies'}, :children => {:count => 0 } + assert_tag 'ul', :attributes => {:class => 'profile-wall-activities-comments scrap-replies'}, :children => {:count => 0 } end should "view more replies paginated" do -- libgit2 0.21.2