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 # can't really redirect to the
21 #post :login, :user_email => "test@openstreetmap.org", :user_password => "test"
23 #get :controller => :users, :action => :new
24 #assert_response :success
25 #print @response.to_yaml
26 #assert_select "html" do
27 # assert_select "body" do
28 # assert_select "div#content" do
29 # assert_select "form" do
30 # assert_select "input[id=diary_entry_title]"
38 def test_editing_diary_entry
40 assert :not_authorized
43 def test_editing_creating_diary_comment
47 def test_listing_diary_entries
57 def test_viewing_diary_entry