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:
- 3391 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | |
3 | class TicketTest < Test::Unit::TestCase |
4 | fixtures :tickets, :parts, :milestones, :severities, :status |
5 | fixtures :releases, :ticket_changes#, :attachments |
6 | |
7 | def setup |
8 | @ticket = Ticket.find(1) |
9 | @ticket2 = Ticket.find(2) |
10 | end |
11 | |
12 | def test_search |
13 | q = Ticket.search("first test ticket") |
14 | exp = [{:content=>"Just testing", |
15 | :title=>"first test ticket", |
16 | :link=>{:id=>1, :controller=>"/tickets", :action=>"show"}}] |
17 | assert_equal exp, q |
18 | end |
19 | |
20 | def test_find_by_filter |
21 | params = {"status"=>"1", "action"=>"filter", "controller"=>"tickets"} |
22 | tickets = Ticket.find_by_filter(params) |
23 | assert_equal 2, tickets.size |
24 | end |
25 | |
26 | def test_find_by_filter2 |
27 | # Will find all tickets |
28 | params = {"stat';us"=>"1", "action"=>"filter", "controller"=>"tickets"} |
29 | tickets = Ticket.find_by_filter(params) |
30 | assert_equal 4, tickets.size |
31 | end |
32 | |
33 | def test_find_by_filter3 |
34 | params = {"milestone"=>"1", "action"=>"filter", "controller"=>"tickets"} |
35 | tickets = Ticket.find_by_filter(params) |
36 | assert_equal 0, tickets.size |
37 | end |
38 | |
39 | def test_edit |
40 | params = {:ticket => {:part_id => 2, |
41 | :release_id => 2, |
42 | :summary => "edited summary", |
43 | :severity_id => 1, |
44 | :status_id => 1, |
45 | :milestone_id => 1}, |
46 | :change => {:attachment => "", |
47 | :author => "bob", |
48 | :comment => ""} |
49 | } |
50 | |
51 | assert @ticket.save(params) |
52 | change = @ticket.ticket_changes.last |
53 | |
54 | assert_equal 2, @ticket.ticket_changes.size |
55 | assert_equal 'edited summary', @ticket.summary |
56 | assert_equal 2, @ticket.part_id |
57 | assert_equal 2, @ticket.release_id |
58 | assert_not_nil change.log |
59 | assert_equal 4, change.log.size |
60 | assert_equal ["first test ticket", "edited summary"], change.log['Summary'] |
61 | assert_equal ["Unspecified", "0.2"], change.log['Release'] |
62 | assert_equal ["Part 1", "Part 2"], change.log['Part'] |
63 | end |
64 | |
65 | def test_edit_with_no_changes |
66 | params = {:ticket => {:part_id => 2, |
67 | :release_id => 2, |
68 | :summary => "second test ticket", |
69 | :severity_id => 2, |
70 | :status_id => 2, |
71 | :milestone_id => 2}, |
72 | :change => {:attachment => "", |
73 | :author => "bob", |
74 | :comment => ""} |
75 | } |
76 | |
77 | assert !@ticket2.save(params) |
78 | assert_equal "No changes has been made", @ticket2.errors['base'] |
79 | end |
80 | |
81 | def test_create |
82 | ticket = Ticket.new(:author => 'bob', |
83 | :part_id => 2, |
84 | :release_id => 2, |
85 | :summary => "new ticket summary", |
86 | :severity_id => 1, |
87 | :status_id => 1, |
88 | :milestone_id => 1, |
89 | :content => 'some random description', |
90 | :author_host => '127.0.0.1') |
91 | assert ticket |
92 | end |
93 | |
94 | def test_validations |
95 | @ticket.author = nil |
96 | assert !@ticket.valid? |
97 | |
98 | @ticket.author = 'foo' |
99 | @ticket.summary = nil |
100 | assert !@ticket.valid? |
101 | |
102 | @ticket.author = 'foo' |
103 | @ticket.summary = 'bar' |
104 | @ticket.content = nil |
105 | assert !@ticket.valid? |
106 | end |
107 | end |