]> git.openstreetmap.org Git - rails.git/blob - test/functional/diary_entry_controller_test.rb
slight more work on the diary test
[rails.git] / test / functional / diary_entry_controller_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'app/controllers/user_controller.rb'
3
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}")
8   end
9
10   def content(c)
11     @request.env["RAW_POST_DATA"] = c.to_s
12   end
13   
14   def test_showing_create_diary_entry
15     get :new
16     assert_response 302
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
20     
21     #
22     get(:new, nil, {'user' => users(:normal_user).id})
23     assert_response :success
24     
25     # can't really redirect to the 
26     #follow_redirect
27     # Now login
28     #post  :login, :user_email => "test@openstreetmap.org", :user_password => "test"
29     
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]"
38     #      end
39     #    end
40     #  end
41     #end
42         
43   end
44   
45   def test_editing_diary_entry
46     get :edit
47     assert :not_authorized
48   end
49   
50   def test_editing_creating_diary_comment
51     
52   end
53   
54   def test_listing_diary_entries
55     
56   end
57   
58   def test_rss
59     get :rss
60     assert :success
61     
62   end
63   
64   def test_viewing_diary_entry
65     
66   end
67 end