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:
- 4349 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | require 'tickets_controller' |
3 | |
4 | # Re-raise errors caught by the controller. |
5 | class TicketsController; def rescue_action(e) raise e end; end |
6 | |
7 | class TicketsControllerTest < Test::Unit::TestCase |
8 | fixtures :tickets, :parts, :milestones, :severities, :status |
9 | fixtures :releases, :ticket_changes#, :attachments |
10 | |
11 | def setup |
12 | @controller = TicketsController.new |
13 | @request = ActionController::TestRequest.new |
14 | @response = ActionController::TestResponse.new |
15 | end |
16 | |
17 | def test_index |
18 | r = get :index |
19 | assert_response :redirect |
20 | assert_redirected_to :action => 'filter', :status => 1 |
21 | end |
22 | |
23 | def test_filter |
24 | r = get :filter, :status => 1 |
25 | assert_response :success |
26 | assert_template 'index' |
27 | assert r.template_objects['tickets'] |
28 | end |
29 | |
30 | def test_show |
31 | r = get :show, :id => 1 |
32 | assert_response :success |
33 | assert_template 'show' |
34 | assert r.template_objects['ticket'] |
35 | |
36 | assert r.template_objects['parts'] |
37 | assert r.template_objects['milestones'] |
38 | assert r.template_objects['severities'] |
39 | assert r.template_objects['status'] |
40 | assert r.template_objects['releases'] |
41 | end |
42 | |
43 | def test_add_comment |
44 | r = post :show, :id => 1, :change => {:author => 'john', :comment => 'this is a comment'} |
45 | assert_response :redirect |
46 | assert_redirected_to :action => 'show', :id => 1 |
47 | |
48 | g = get :show, :id => 1 |
49 | assert_equal 'this is a comment', g.template_objects['ticket'].ticket_changes.last.comment |
50 | end |
51 | |
52 | def test_add_invalid_comment_without_author |
53 | r = post :show, :id => 1, :change => {:author => '', :comment => 'this is a comment'} |
54 | assert_response :success |
55 | assert r.template_objects['change'].errors.on('author') |
56 | end |
57 | |
58 | def test_edit |
59 | r = post :show, :id => 2, :ticket => {:part_id => 2, |
60 | :author => "bob", |
61 | :release_id => 0, |
62 | :summary => "blabla", |
63 | :content => "this is a ticket", |
64 | :severity_id => 2, |
65 | :milestone_id => 2}, |
66 | :change => {:author => 'john', :comment => 'blabla'} |
67 | assert_response :redirect |
68 | assert_redirected_to :action => 'show', :id => 2 |
69 | end |
70 | |
71 | def test_invalid_edit |
72 | r = post :show, :id => 2, :ticket => { :part_id => 2, |
73 | :author => "bob", |
74 | :release_id => "", |
75 | :summary => "", |
76 | :content => "this is a ticket", |
77 | :severity_id => 2, |
78 | :milestone_id=>2 |
79 | }, :change => {:author => 'john', :comment => 'fubar'} |
80 | assert_response :success |
81 | assert r.template_objects['ticket'].errors.on('summary') |
82 | end |
83 | |
84 | def test_get_new |
85 | r = get :new |
86 | assert_response :success |
87 | assert_template 'new' |
88 | assert r.template_objects['ticket'] |
89 | |
90 | assert r.template_objects['parts'] |
91 | assert r.template_objects['milestones'] |
92 | assert r.template_objects['severities'] |
93 | assert r.template_objects['releases'] |
94 | end |
95 | |
96 | def test_create |
97 | post :new, "ticket" => { "part_id" => "1", |
98 | "author" => "bob", |
99 | "release_id" => "", |
100 | "summary" => "testing", |
101 | "content" => "this is a ticket", |
102 | "severity_id" => "1", |
103 | "milestone_id"=>"1"} |
104 | assert_response :redirect |
105 | assert_redirected_to :action => 'show', :id => 5 |
106 | end |
107 | |
108 | def test_invalid_create |
109 | r = post :new, "ticket" => { "part_id" => "1", |
110 | "author" => "bob", |
111 | "release_id" => "", |
112 | "summary" => "", |
113 | "content" => "this is a ticket", |
114 | "severity_id" => "1", |
115 | "milestone_id"=>"1"} |
116 | assert_response :success |
117 | assert r.template_objects['ticket'].errors.on('summary') |
118 | end |
119 | |
120 | end |