slight more work on the diary test
authorShaun McDonald <shaun@shaunmcdonald.me.uk>
Mon, 10 Nov 2008 19:21:59 +0000 (19:21 +0000)
committerShaun McDonald <shaun@shaunmcdonald.me.uk>
Mon, 10 Nov 2008 19:21:59 +0000 (19:21 +0000)
test/functional/diary_entry_controller_test.rb

index a8d0adf6dc82daf5ff31e77b3ef69cb845012206..31c62fe9fd3d04de67eb5316ee98cb899147c14c 100644 (file)
@@ -15,6 +15,13 @@ class DiaryEntryControllerTest < ActionController::TestCase
     get :new
     assert_response 302
     assert_redirected_to :controller => :user, :action => "login", :referer => "/diary_entry/new"
+    # Now pretend to login by using the session hash, with the 
+    # id of the person we want to login as through session(:user)=user.id
+    
+    #
+    get(:new, nil, {'user' => users(:normal_user).id})
+    assert_response :success
+    
     # can't really redirect to the 
     #follow_redirect
     # Now login