diff --git a/app/helpers/blog_helper.rb b/app/helpers/blog_helper.rb
index ecab000..4efe3aa 100644
--- a/app/helpers/blog_helper.rb
+++ b/app/helpers/blog_helper.rb
@@ -11,7 +11,7 @@ module BlogHelper
end
def cms_label_for_edit
- _('Edit blog')
+ _('Configure blog')
end
def list_posts(user, articles, format = 'full')
diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml
index c19a2ca..0321074 100644
--- a/app/views/content_viewer/view_page.rhtml
+++ b/app/views/content_viewer/view_page.rhtml
@@ -12,11 +12,9 @@
<%= article_title(@page, :no_link => true) %>
<% if @page.allow_post_content?(user) %>
- <% unless @page.blog? %>
<%= link_to content_tag( 'span', label_for_edit_article(@page) ),
profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
:class => 'button with-text icon-edit' %>
- <% end %>
<% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
<% if @page != profile.home_page && !@page.blog? %>
<%= link_to content_tag( 'span', _('Delete') ),
diff --git a/features/blog.feature b/features/blog.feature
index b9cbae6..8c75bf0 100644
--- a/features/blog.feature
+++ b/features/blog.feature
@@ -78,6 +78,14 @@ Feature: blog
When I follow "Configure blog"
Then I should be on edit "Blog One" by joaosilva
+ Scenario: configure blog when viewing it
+ Given the following blogs
+ | owner | name |
+ | joaosilva | Blog One |
+ And I go to /joaosilva/blog-one
+ When I follow "Configure blog"
+ Then I should be on edit "Blog One" by joaosilva
+
Scenario: change address of blog
Given the following blogs
| owner | name |
diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb
index a4f8d49..c25f774 100644
--- a/test/functional/content_viewer_controller_test.rb
+++ b/test/functional/content_viewer_controller_test.rb
@@ -902,4 +902,11 @@ class ContentViewerControllerTest < Test::Unit::TestCase
assert_no_tag :tag => 'div', :attributes => { :class => 'short-post'}, :content => /Anything/
end
+ should 'display link to edit blog for allowed' do
+ blog = fast_create(Blog, :profile_id => profile.id, :path => 'blog')
+ login_as(profile.identifier)
+ get :view_page, :profile => profile.identifier, :page => blog.explode_path
+ assert_tag :tag => 'div', :attributes => { :class => /main-block/ }, :descendant => { :tag => 'a', :attributes => { :href => "/myprofile/testinguser/cms/edit/#{blog.id}" }, :content => 'Configure blog' }
+ end
+
end
--
libgit2 0.21.2