diff options
author | Jamie Winsor <jamie@enmasse.com> | 2011-08-04 15:39:04 -0700 |
---|---|---|
committer | Jamie Winsor <jamie@enmasse.com> | 2011-08-04 15:39:04 -0700 |
commit | ee215655cba5820c3ffe0c665ea71c11f15f3bf9 (patch) | |
tree | aa1da7816aecf14c2033dff124cf867f30b7581b /spec | |
parent | 8bd056e3e8baa108b2e10e460ceeeed3ec7c4c86 (diff) | |
download | refinerycms-blog-ee215655cba5820c3ffe0c665ea71c11f15f3bf9.tar.gz refinerycms-blog-ee215655cba5820c3ffe0c665ea71c11f15f3bf9.tar.bz2 refinerycms-blog-ee215655cba5820c3ffe0c665ea71c11f15f3bf9.zip |
Replace cucumber tag features with rspec request tests
Remove cucumber support from project
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/blog_posts_spec.rb | 18 | ||||
-rw-r--r-- | spec/requests/manage_blog_posts_spec.rb | 22 |
2 files changed, 40 insertions, 0 deletions
diff --git a/spec/requests/blog_posts_spec.rb b/spec/requests/blog_posts_spec.rb index 1eaf27a..d7d2a9f 100644 --- a/spec/requests/blog_posts_spec.rb +++ b/spec/requests/blog_posts_spec.rb @@ -17,4 +17,22 @@ describe "blog posts" do response.content_type.should eq("application/rss+xml") end end + + describe "list tagged posts" do + context "when has tagged blog posts" do + before(:each) do + @tag_name = "chicago" + @blog_post = Factory.create(:blog_post, + :title => "I Love my city", + :tag_list => @tag_name) + tag = ::Refinery::BlogPost.tag_counts_on(:tags).first + visit tagged_posts_path(tag.id, @tag_name.parameterize) + end + + it "should have one tagged post" do + page.should have_content(@tag_name) + page.should have_content(@blog_post.title) + end + end + end end diff --git a/spec/requests/manage_blog_posts_spec.rb b/spec/requests/manage_blog_posts_spec.rb index 12b7b8f..6d6f734 100644 --- a/spec/requests/manage_blog_posts_spec.rb +++ b/spec/requests/manage_blog_posts_spec.rb @@ -55,6 +55,28 @@ describe "manage blog posts" do ::Refinery::BlogPost.last.categories.first.title.should eq(blog_category.title) end end + + describe "create blog post with tags" do + before(:each) do + @tag_list = "chicago, bikes, beers, babes" + fill_in "Title", :with => "This is a tagged blog post" + fill_in "blog_post_body", :with => "And I also love it" + fill_in "Tags", :with => @tag_list + click_button "Save" + end + + it "should succeed" do + page.should have_content("was successfully added.") + end + + it "should be the only blog post" do + ::Refinery::BlogPost.all.size.should eq(1) + end + + it "should have the specified tags" do + ::Refinery::BlogPost.last.tag_list.should eq(@tag_list.split(', ')) + end + end end end |