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