1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'app/controllers/user_controller.rb'
4 class DiaryEntryControllerTest < ActionController::TestCase
5 fixtures :users, :diary_entries, :diary_comments
6 def basic_authorization(user, pass)
7 @request.env["HTTP_AUTHORIZATION"] = "Basic %s" % Base64.encode64("#{user}:#{pass}")
11 @request.env["RAW_POST_DATA"] = c.to_s
14 def test_showing_create_diary_entry
17 assert_redirected_to :controller => :user, :action => "login", :referer => "/diary_entry/new"
18 # Now pretend to login by using the session hash, with the
19 # id of the person we want to login as through session(:user)=user.id
22 get(:new, nil, {'user' => users(:normal_user).id})
23 assert_response :success
25 # can't really redirect to the
28 #post :login, :user_email => "test@openstreetmap.org", :user_password => "test"
30 #get :controller => :users, :action => :new
31 #assert_response :success
32 #print @response.to_yaml
33 #assert_select "html" do
34 # assert_select "body" do
35 # assert_select "div#content" do
36 # assert_select "form" do
37 # assert_select "input[id=diary_entry_title]"
45 def test_editing_diary_entry
47 assert :not_authorized
50 def test_editing_creating_diary_comment
54 def test_listing_diary_entries
64 def test_viewing_diary_entry