Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 7
- Log:
Initial import of RForum 0.2 sources from a downloaded Tarball.
RForum is a Ruby On Rails based forum and mail gateway service.
- Author:
- adh
- Date:
- Sat Jul 22 18:43:13 +0100 2006
- Size:
- 1174 Bytes
- Properties:
- Property svn:executable is set
1 | #!/bin/env ruby |
2 | |
3 | require File.dirname(__FILE__) + '/../test_helper' |
4 | |
5 | class CommonModelBehaviorsTest < Test::Unit::TestCase |
6 | |
7 | def test_check_mandatory_atributes |
8 | p = prototype(Post) |
9 | assert_nothing_raised { p.check_mandatory_atributes(:l) } |
10 | p.l = nil |
11 | assert_raise(ArgumentError) { p.check_mandatory_atributes(:l) } |
12 | end |
13 | |
14 | class FooThatFailsValidation < Post |
15 | def validate |
16 | self.errors.add('dummy field', 'always fails') |
17 | end |
18 | end |
19 | |
20 | def test_error_raising |
21 | assert_raises(RForum::ValidationError) { FooThatFailsValidation.create(prototype_params(Post)) } |
22 | end |
23 | |
24 | def test_valid_email? |
25 | p = prototype(Post) |
26 | |
27 | assert p.valid_email?('new_user@foo.bar') |
28 | |
29 | assert !(p.valid_email? '') |
30 | assert !(p.valid_email? 'aaa') |
31 | assert !(p.valid_email? 'aaa@aaa') |
32 | assert !(p.valid_email? 'aaa@aaa@asd') |
33 | assert p.valid_email?('some_user@yandex.ru') |
34 | assert p.valid_email?('some_user@somewhere-else.info') |
35 | |
36 | # very long email check |
37 | s = 'a@a.a' |
38 | s.length.upto(98) { s += 'a' } |
39 | assert_equal 99, s.length |
40 | assert_match /.@.+\../, s |
41 | assert p.valid_email?(s) |
42 | s += 'a' |
43 | assert !(p.valid_email?(s)) |
44 | end |
45 | |
46 | end |
47 |