aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2012-06-15 12:10:44 +0300
committerUģis Ozols <ugis.ozolss@gmail.com>2012-06-15 12:10:44 +0300
commitfc97c846689d545a2b3844c8f9810eda129c8803 (patch)
treea90182080b121ce26cd016c6adef1649cb4f3a0b
parent5781ea10d8d55e49439915bbed473781c9bf32fe (diff)
downloadrefinerycms-blog-fc97c846689d545a2b3844c8f9810eda129c8803.tar.gz
refinerycms-blog-fc97c846689d545a2b3844c8f9810eda129c8803.tar.bz2
refinerycms-blog-fc97c846689d545a2b3844c8f9810eda129c8803.zip
Fix failing specs.
-rw-r--r--app/models/refinery/blog/post.rb2
-rw-r--r--spec/requests/refinery/blog/posts_spec.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb
index 024872e..9df7aa3 100644
--- a/app/models/refinery/blog/post.rb
+++ b/app/models/refinery/blog/post.rb
@@ -115,7 +115,7 @@ module Refinery
end
def uncategorized
- live.includes(:categories).where(:categories => { Refinery::Categorization.table_name => { :blog_category_id => nil } }).with_globalize
+ live.includes(:categories).where(Refinery::Categorization.table_name => { :blog_category_id => nil }).with_globalize
end
def next(current_record)
diff --git a/spec/requests/refinery/blog/posts_spec.rb b/spec/requests/refinery/blog/posts_spec.rb
index b6cc7ca..380e600 100644
--- a/spec/requests/refinery/blog/posts_spec.rb
+++ b/spec/requests/refinery/blog/posts_spec.rb
@@ -157,6 +157,7 @@ module Refinery
describe "#show draft preview" do
let(:blog_post) { FactoryGirl.create(:blog_post_draft) }
+
context "when logged in as admin" do
it "should display the draft notification" do
visit refinery.blog_post_path(blog_post)
@@ -164,8 +165,11 @@ module Refinery
page.should have_content('This page is NOT live for public viewing.')
end
end
+
context "when not logged in as an admin" do
- before(:each) { visit refinery.destroy_refinery_user_session_path }
+ before do
+ visit refinery.logout_path
+ end
it "should not display the blog post" do
visit refinery.blog_post_path(blog_post)