From 9cd6c80322778bf38a3873fd76e6707a8667cbad Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 25 Jul 2008 21:48:13 +0000 Subject: [PATCH] ActionItem519: comment form must post to article URL --- app/views/content_viewer/_comment_form.rhtml | 2 +- test/functional/content_viewer_controller_test.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/content_viewer/_comment_form.rhtml b/app/views/content_viewer/_comment_form.rhtml index 497c589..2267ba8 100644 --- a/app/views/content_viewer/_comment_form.rhtml +++ b/app/views/content_viewer/_comment_form.rhtml @@ -17,7 +17,7 @@

<%= _('Post a comment') %>

-<% form_tag( {}, { :id => comment_form_id } ) do %> +<% form_tag( @page.url, { :id => comment_form_id } ) do %> <% unless logged_in? %> diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 51ad62f..fb91df0 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -226,6 +226,15 @@ class ContentViewerControllerTest < Test::Unit::TestCase assert_no_tag :tag => 'strong', :attributes => { :id => 'html_test_comment' } end + should "point to article's url in comment form" do + page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text') + Article.any_instance.stubs(:url).returns('http://www.mysite.com/person/article') + + get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ] + + assert_tag :tag => 'form', :attributes => { :id => /^comment_form/, :action => 'http://www.mysite.com/person/article' } + end + should "display current article's tags" do page = profile.articles.create!(:name => 'myarticle', :body => 'test article', :tag_list => 'tag1, tag2') -- libgit2 0.21.2