aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/features/refinery/blog/admin/categories_spec.rb8
-rw-r--r--spec/features/refinery/blog/admin/posts_spec.rb4
-rw-r--r--spec/spec_helper.rb2
3 files changed, 7 insertions, 7 deletions
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
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 7b20bf0..bddb8bc 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,5 +1,4 @@
require 'rubygems'
-require 'capybara/poltergeist'
# Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test'
@@ -18,6 +17,7 @@ RSpec.configure do |config|
end
# set javascript driver for capybara
+require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
# Requires supporting files with custom matchers and macros, etc,