diff options
-rw-r--r-- | app/models/refinery/blog/post.rb | 2 | ||||
-rw-r--r-- | spec/requests/refinery/blog/posts_spec.rb | 6 |
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) |