Commit 9cd6c80322778bf38a3873fd76e6707a8667cbad

Authored by AntonioTerceiro
1 parent cab263df

ActionItem519: comment form must post to article URL

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2324 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/content_viewer/_comment_form.rhtml
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 17
18 <h4><%= _('Post a comment') %></h4> 18 <h4><%= _('Post a comment') %></h4>
19 19
20 -<% form_tag( {}, { :id => comment_form_id } ) do %> 20 +<% form_tag( @page.url, { :id => comment_form_id } ) do %>
21 21
22 <% unless logged_in? %> 22 <% unless logged_in? %>
23 23
test/functional/content_viewer_controller_test.rb
@@ -226,6 +226,15 @@ class ContentViewerControllerTest &lt; Test::Unit::TestCase @@ -226,6 +226,15 @@ class ContentViewerControllerTest &lt; Test::Unit::TestCase
226 assert_no_tag :tag => 'strong', :attributes => { :id => 'html_test_comment' } 226 assert_no_tag :tag => 'strong', :attributes => { :id => 'html_test_comment' }
227 end 227 end
228 228
  229 + should "point to article's url in comment form" do
  230 + page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text')
  231 + Article.any_instance.stubs(:url).returns('http://www.mysite.com/person/article')
  232 +
  233 + get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ]
  234 +
  235 + assert_tag :tag => 'form', :attributes => { :id => /^comment_form/, :action => 'http://www.mysite.com/person/article' }
  236 + end
  237 +
229 should "display current article's tags" do 238 should "display current article's tags" do
230 page = profile.articles.create!(:name => 'myarticle', :body => 'test article', :tag_list => 'tag1, tag2') 239 page = profile.articles.create!(:name => 'myarticle', :body => 'test article', :tag_list => 'tag1, tag2')
231 240