diff options
-rw-r--r-- | spec/requests/blog_categories_spec.rb | 3 | ||||
-rw-r--r-- | spec/requests/blog_posts_spec.rb | 4 | ||||
-rw-r--r-- | spec/requests/manage_blog_posts_spec.rb | 9 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 |
4 files changed, 6 insertions, 12 deletions
diff --git a/spec/requests/blog_categories_spec.rb b/spec/requests/blog_categories_spec.rb index 33d330b..8ac6eff 100644 --- a/spec/requests/blog_categories_spec.rb +++ b/spec/requests/blog_categories_spec.rb @@ -1,8 +1,9 @@ require "spec_helper" describe "blog categories" do + login_refinery_user + before(:each) do - Factory.create(:refinery_user) @blog_post = Factory(:blog_post, :title => "Refinery CMS blog post") @blog_category = Factory(:blog_category, :title => "Video Games") @blog_post.categories << @blog_category diff --git a/spec/requests/blog_posts_spec.rb b/spec/requests/blog_posts_spec.rb index 8695d9a..1eaf27a 100644 --- a/spec/requests/blog_posts_spec.rb +++ b/spec/requests/blog_posts_spec.rb @@ -1,9 +1,7 @@ require "spec_helper" describe "blog posts" do - before(:each) do - Factory.create(:refinery_user) - end + login_refinery_user context "when has blog posts" do let(:blog_post) { Factory(:blog_post, :title => "Refinery CMS blog post") } diff --git a/spec/requests/manage_blog_posts_spec.rb b/spec/requests/manage_blog_posts_spec.rb index 8b1097d..724cc59 100644 --- a/spec/requests/manage_blog_posts_spec.rb +++ b/spec/requests/manage_blog_posts_spec.rb @@ -1,14 +1,7 @@ require "spec_helper" describe "manage blog posts" do - # TODO: share this with other request specs - before(:each) do - user = Factory.create(:refinery_user) - visit new_refinery_user_session_url - fill_in "Login", :with => user.username - fill_in "Password", :with => user.password - click_button "Sign in" - end + login_refinery_user let!(:blog_post) { Factory(:blog_post, :title => "Refinery CMS blog post") } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 44506ce..5a8d67c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,6 +42,8 @@ Spork.prefork do end config.include Devise::TestHelpers, :type => :controller + config.extend Refinery::ControllerMacros::Authentication, :type => :controller + config.extend Refinery::RequestMacros::Authentication, :type => :request end end |