Commit 1ee5c472

mo khan <mo@mokhan.ca>
2013-05-09 13:31:59
add spec for redirecting after creating an avatar
1 parent 199c083
Changed files (1)
spec/controllers/avatars_controller_spec.rb
@@ -3,9 +3,7 @@ require "spec_helper"
 describe AvatarsController do
   let(:user) { FactoryGirl.create(:user) }
 
-  before :each do
-    http_login(user)
-  end
+  before { http_login(user) }
 
   describe :create do
     context "when uploading a new avatar" do
@@ -16,6 +14,10 @@ describe AvatarsController do
       it "should save the new avatar" do
         Avatar.last.should_not be_nil
       end
+
+      it "should redirect to the profile page" do
+        response.should redirect_to(profile_path(user))
+      end
     end
   end
 end