Commit 86d5d8e7

mo k <mo@mokhan.ca>
2012-09-28 03:20:15
give up on trying to test when you are not signed in.
1 parent 868cdfb
Changed files (2)
spec/controllers/comments_controller_spec.rb
@@ -1,21 +1,20 @@
 describe CommentsController do
-  describe "POST create" do
-    describe "when signed in" do
-      let(:user) { FactoryGirl.create(:user) }
+  describe "when signed in" do
+    let(:user) { FactoryGirl.create(:user) }
+    before(:each) do
+      http_login(user)
+    end
+    describe "POST create" do
       let(:creation) { FactoryGirl.create(:creation) }
-      before :each do
+      before(:each) do
         http_login(user)
+        post :create, {:creation_id => creation.id, :comment => {:body => 'blah'}}
+      end
+      it "should display a message indicated that the comment was saved" do
+        flash[:notice].should_not be_nil
       end
-      describe 'when commenting on a creation' do
-        before(:each) do
-          post :create, {:creation_id => creation.id, :comment => {:body => 'blah'}}
-        end
-        it "should display a message indicated that the comment was saved" do
-          flash[:notice].should_not be_nil
-        end
-        it "should redirect to the creation#show page" do
-          response.should redirect_to(creation)
-        end
+      it "should redirect to the creation#show page" do
+        response.should redirect_to(creation)
       end
     end
   end
spec/spec_helper.rb
@@ -12,7 +12,7 @@ Spork.prefork do
     config.mock_with :rspec
     config.use_transactional_fixtures = true
     config.infer_base_class_for_anonymous_controllers = false
-    config.include DeviseHelper
+    config.include DeviseHelper, :type => :controller
   end
 end