]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/diary_entry_controller_test.rb
more diary entry tests, and a minor fix to the relation member that makes the code...
[rails.git] / test / functional / diary_entry_controller_test.rb
index a8d0adf6dc82daf5ff31e77b3ef69cb845012206..ca9ce4c364ca5f9691ef34b52a82dbf3dc732327 100644 (file)
@@ -15,23 +15,22 @@ class DiaryEntryControllerTest < ActionController::TestCase
     get :new
     assert_response 302
     assert_redirected_to :controller => :user, :action => "login", :referer => "/diary_entry/new"
-    # can't really redirect to the 
-    #follow_redirect
-    # Now login
-    #post  :login, :user_email => "test@openstreetmap.org", :user_password => "test"
-    
-    #get :controller => :users, :action => :new
-    #assert_response :success
+    # 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
+    #print @response.body
+        
     #print @response.to_yaml
-    #assert_select "html" do
-    #  assert_select "body" do
-    #    assert_select "div#content" do
-    #      assert_select "form" do
-    #        assert_select "input[id=diary_entry_title]"
-    #      end
-    #    end
-    #  end
-    #end
+    assert_select "html" do
+      assert_select "body" do
+        assert_select "div#content" do
+          assert_select "form" do
+            assert_select "input[id=diary_entry_title]"
+          end
+        end
+      end
+    end
         
   end