Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 24
- Log:
Initial import of Collaboa 0.5.6 from downloaded Tarball. Collaboa is
a Ruby On Rails based bug tracker and SVN repository browsing tool.
- Author:
- adh
- Date:
- Mon Jul 24 21:54:39 +0100 2006
- Size:
- 2732 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | require 'repository_controller' |
3 | |
4 | # Re-raise errors caught by the controller. |
5 | class RepositoryController; def rescue_action(e) raise e end; end |
6 | |
7 | class RepositoryControllerTest < Test::Unit::TestCase |
8 | def setup |
9 | @controller = RepositoryController.new |
10 | @request = ActionController::TestRequest.new |
11 | @response = ActionController::TestResponse.new |
12 | end |
13 | |
14 | def test_view_changesets |
15 | get :changesets |
16 | assert_response :success |
17 | assert_template 'changesets' |
18 | end |
19 | |
20 | def test_show_changeset |
21 | r = get :show_changeset, 'revision' => "3" |
22 | assert_response :success |
23 | assert_template 'show_changeset' |
24 | assert_equal "edited file1.txt again", r.template_objects['changeset'].log |
25 | assert_equal 1, r.template_objects['changeset'].changes.size |
26 | end |
27 | |
28 | def test_index |
29 | get :index |
30 | assert_response :redirect |
31 | assert_redirected_to(:action => 'browse') |
32 | end |
33 | |
34 | def test_browse |
35 | get :browse, 'path' => [] |
36 | assert_response :success |
37 | assert_template 'browse' |
38 | |
39 | r = get :browse, 'path' => ["html"] |
40 | assert_response :success |
41 | assert_template 'browse' |
42 | end |
43 | |
44 | def test_browse_file |
45 | get :browse, 'path' => ["file.txt"] |
46 | assert_response :redirect |
47 | assert_redirected_to(:action => 'view_file') |
48 | |
49 | r = get :view_file, 'path' => ["file.txt"] |
50 | assert_response :success |
51 | assert_template 'showfile' |
52 | assert_equal "I am the silly test file!\n", r.template_objects['file'].contents |
53 | end |
54 | |
55 | def test_alternative_formats |
56 | get :view_file, 'path' => ["file.txt"], :format => 'txt' |
57 | assert_response :success |
58 | |
59 | get :view_file, 'path' => ["file.txt"], :format => 'raw' |
60 | assert_response :success |
61 | end |
62 | |
63 | def test_routes |
64 | # file viewer |
65 | wanted_file = { :controller => 'repository', :action => 'view_file', :path => ["file.txt"] } |
66 | #assert_generates "repository/file/file1.txt", wanted_file |
67 | assert_recognizes wanted_file, "repository/file/file.txt" |
68 | |
69 | # file view2 |
70 | wanted_file = { :controller => 'repository', :action => 'view_file', :path => ["html", "html_file.html"] } |
71 | #assert_generates "repository/file/file1.txt", wanted_file |
72 | assert_recognizes wanted_file, "repository/file/html/html_file.html" |
73 | |
74 | # browser |
75 | wanted_dir = { :controller => 'repository', :action => 'browse', :path => ["html"] } |
76 | #assert_generates "repository/browse/html", wanted_dir |
77 | assert_recognizes wanted_dir, "repository/browse/html" |
78 | |
79 | # a specific changeset |
80 | wanted = { :controller => 'repository', :action => 'show_changeset', :revision => "1" } |
81 | #assert_generates "repository/changesets/1", wanted |
82 | assert_recognizes wanted, "repository/changesets/1" |
83 | end |
84 | end |