From b4064c760b80c99850527d50984cc6e611168a05 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Thu, 5 Mar 2015 11:52:10 +1300 Subject: Fixed test failures relating to not finding the title. --- spec/features/refinery/blog/admin/categories_spec.rb | 8 ++++---- spec/features/refinery/blog/admin/posts_spec.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'spec/features/refinery') diff --git a/spec/features/refinery/blog/admin/categories_spec.rb b/spec/features/refinery/blog/admin/categories_spec.rb index b3e3f31..7a8df8c 100644 --- a/spec/features/refinery/blog/admin/categories_spec.rb +++ b/spec/features/refinery/blog/admin/categories_spec.rb @@ -35,8 +35,8 @@ describe "Categories admin", type: :feature do visit refinery.blog_admin_posts_path click_link "Create new category" fill_in "Title", :with => "Testing Category" - click_button "Save" - @c = Refinery::Blog::Category.find_by_title("Testing Category") + expect { click_button "Save" }.to change(Refinery::Blog::Category, :count).by(1) + @c = Refinery::Blog::Category.by_title("Testing Category") end it "suceeds" do @@ -76,8 +76,8 @@ describe "Categories admin", type: :feature do click_link "RU" end fill_in "Title", :with => ru_category_title - click_button "Save" - @c = Refinery::Blog::Category.find_by_title(ru_category_title) + expect { click_button "Save" }.to change(Refinery::Blog::Category, :count).by(1) + @c = Refinery::Blog::Category.by_title(ru_category_title) end it "suceeds" do diff --git a/spec/features/refinery/blog/admin/posts_spec.rb b/spec/features/refinery/blog/admin/posts_spec.rb index 230b64c..9faf061 100644 --- a/spec/features/refinery/blog/admin/posts_spec.rb +++ b/spec/features/refinery/blog/admin/posts_spec.rb @@ -200,7 +200,7 @@ module Refinery fill_in "Title", :with => "Post" fill_in "post_body", :with => "One post in my blog" click_button "Save" - @p = Refinery::Blog::Post.find_by_title("Post") + @p = Refinery::Blog::Post.by_title("Post") end it "succeeds" do @@ -239,7 +239,7 @@ module Refinery fill_in "Title", :with => ru_page_title fill_in "post_body", :with => "One post in my blog" click_button "Save" - @p = Refinery::Blog::Post.find_by_title(ru_page_title) + @p = Refinery::Blog::Post.by_title(ru_page_title) end it "succeeds" do -- cgit v1.2.3