diff options
Diffstat (limited to 'spec/features/refinery/blog/posts_spec.rb')
-rw-r--r-- | spec/features/refinery/blog/posts_spec.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/spec/features/refinery/blog/posts_spec.rb b/spec/features/refinery/blog/posts_spec.rb index daba07e..a96b63a 100644 --- a/spec/features/refinery/blog/posts_spec.rb +++ b/spec/features/refinery/blog/posts_spec.rb @@ -12,7 +12,7 @@ module Refinery it "should display blog post" do visit refinery.blog_post_path(blog_post) - page.should have_content(blog_post.title) + expect(page).to have_content(blog_post.title) end describe "visit blog" do @@ -25,14 +25,14 @@ module Refinery it "shows blog link in menu" do visit "/" within "#menu" do - page.should have_content("Blog") - page.should have_selector("a[href='/blog']") + expect(page).to have_content("Blog") + expect(page).to have_selector("a[href='/blog']") end end it "shows blog posts" do visit refinery.blog_root_path - page.should have_content blog_post.title + expect(page).to have_content blog_post.title end end @@ -51,8 +51,8 @@ module Refinery it "should have one tagged post" do visit refinery.blog_tagged_posts_path(@tag.id, @tag_name.parameterize) - page.should have_content(@tag_name) - page.should have_content(@post.title) + expect(page).to have_content(@tag_name) + expect(page).to have_content(@post.title) end end end @@ -63,8 +63,8 @@ module Refinery it "should display the blog post" do visit refinery.blog_post_path(blog_post) - page.should have_content(blog_post.title) - page.should have_content(blog_post.body) + expect(page).to have_content(blog_post.title) + expect(page).to have_content(blog_post.body) end end context "when has approved comments" do @@ -73,8 +73,8 @@ module Refinery it "should display the comments" do visit refinery.blog_post_path(approved_comment.post) - page.should have_content(approved_comment.body) - page.should have_content("Posted by #{approved_comment.name}") + expect(page).to have_content(approved_comment.body) + expect(page).to have_content("Posted by #{approved_comment.name}") end end context "when has rejected comments" do @@ -83,7 +83,7 @@ module Refinery it "should not display the comments" do visit refinery.blog_post_path(rejected_comment.post) - page.should_not have_content(rejected_comment.body) + expect(page).not_to have_content(rejected_comment.body) end end context "when has new comments" do @@ -92,7 +92,7 @@ module Refinery it "should not display the comments" do visit refinery.blog_post_path(blog_comment.post) - page.should_not have_content(blog_comment.body) + expect(page).not_to have_content(blog_comment.body) end end @@ -114,9 +114,9 @@ module Refinery 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) + expect(comment.name).to eq(name) + expect(comment.email).to eq(email) + expect(comment.body).to eq(body) end end @@ -129,13 +129,13 @@ module Refinery end it "should increment access count" do - blog_post.reload.access_count.should eq(1) + expect(blog_post.reload.access_count).to eq(1) visit refinery.blog_post_path(blog_post) - blog_post.reload.access_count.should eq(2) + expect(blog_post.reload.access_count).to eq(2) end it "should be most popular" do - Refinery::Blog::Post.popular(2).first.should eq(blog_post) + expect(Refinery::Blog::Post.popular(2).first).to eq(blog_post) end end @@ -144,7 +144,7 @@ module Refinery let!(:blog_post2) { FactoryGirl.create(:blog_post, :published_at => Time.now - 2.minutes) } it "should be the most recent" do - Refinery::Blog::Post.recent(2).first.id.should eq(blog_post2.id) + expect(Refinery::Blog::Post.recent(2).first.id).to eq(blog_post2.id) end end @@ -157,7 +157,7 @@ module Refinery it "should display the draft notification" do visit refinery.blog_post_path(blog_post) - page.should have_content('This page is NOT live for public viewing.') + expect(page).to have_content('This page is NOT live for public viewing.') end end @@ -172,7 +172,7 @@ module Refinery it "should not display the blog post" do visit refinery.blog_post_path(blog_post) - page.should have_content("The page you requested was not found.") + expect(page).to have_content("The page you requested was not found.") end end end |