aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests/refinery/blog
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2012-01-24 14:42:54 -0800
committerPete Higgins <pete@peterhiggins.org>2012-01-24 14:42:54 -0800
commit3abf537eaaff430cfb41fa51a8a377ce4b8ac924 (patch)
treea856ac15a926f67eacd774066c63fc2b520391c0 /spec/requests/refinery/blog
parentb1e4fd00943a160f3eb6ce242463c0cc07a406fc (diff)
downloadrefinerycms-blog-3abf537eaaff430cfb41fa51a8a377ce4b8ac924.tar.gz
refinerycms-blog-3abf537eaaff430cfb41fa51a8a377ce4b8ac924.tar.bz2
refinerycms-blog-3abf537eaaff430cfb41fa51a8a377ce4b8ac924.zip
Fix comment posting.
Diffstat (limited to 'spec/requests/refinery/blog')
-rw-r--r--spec/requests/refinery/blog/posts_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/requests/refinery/blog/posts_spec.rb b/spec/requests/refinery/blog/posts_spec.rb
index 71a90f7..471a460 100644
--- a/spec/requests/refinery/blog/posts_spec.rb
+++ b/spec/requests/refinery/blog/posts_spec.rb
@@ -77,6 +77,30 @@ module Refinery
page.should_not have_content(blog_comment.body)
end
end
+
+ context "when posting comments" do
+ let(:blog_post) { Factory(:blog_post) }
+ let(:name) { "pete" }
+ let(:email) { "pete@mcawesome.com" }
+ let(:body) { "Witty comment." }
+
+ before do
+ visit refinery_blog_post_path(blog_post)
+
+ fill_in "Name", :with => name
+ fill_in "Email", :with => email
+ fill_in "Message", :with => body
+ click_button "Send comment"
+ end
+
+ it "creates the comment" do
+ comment = blog_post.reload.comments.last
+
+ comment.name.should eq(name)
+ comment.email.should eq(email)
+ comment.body.should eq(body)
+ end
+ end
end
describe "#show draft preview" do