File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 11
11
owner : visitor_1
12
12
body : Un si joli journal
13
13
wiki_body : Un si joli journal
14
+ created_at : <%= 4.months.ago %>
14
15
15
16
lorem_cc_licensed :
16
17
title : Lorem ipsum
Original file line number Diff line number Diff line change @@ -4,13 +4,20 @@ class AccountTest < ActiveSupport::TestCase
4
4
def test_should_create_account
5
5
assert_difference 'Account.count' do
6
6
account = new_account
7
+
7
8
assert account . save , account . errors . full_messages . to_sentence
8
9
end
9
10
end
10
11
12
+ test 'should get anonymous account' do
13
+ assert Account . anonymous
14
+ assert_equal 'Anonyme' , Account . anonymous . login
15
+ end
16
+
11
17
def test_should_require_login
12
18
assert_no_difference 'Account.count' do
13
19
account = new_account ( login : nil )
20
+
14
21
assert_not account . save , account . errors . full_messages . to_sentence
15
22
end
16
23
end
Original file line number Diff line number Diff line change
1
+ require 'test_helper'
2
+
3
+ class ContentTest < ActiveSupport ::TestCase
4
+ test 'should not create naked content' do
5
+ assert_raises NotImplementedError do
6
+ Content . create
7
+ end
8
+ end
9
+
10
+ test 'should get label for expand' do
11
+ assert_equal 'Lire la suite' , Poll . first . label_for_expand
12
+ end
13
+
14
+ test 'should get alternative formats' do
15
+ assert Poll . first . alternative_formats
16
+ assert_not Bookmark . first . alternative_formats
17
+ end
18
+
19
+ test 'should get lastmod' do
20
+ assert_equal polls ( :one ) . updated_at , polls ( :one ) . lastmod
21
+ end
22
+
23
+ test 'should get changefreq' do
24
+ assert_equal 'hourly' , polls ( :one ) . changefreq
25
+ polls ( :draft ) . created_at = 2 . days . ago
26
+
27
+ assert_equal 'daily' , polls ( :draft ) . changefreq
28
+ polls ( :draft ) . created_at = 4 . days . ago
29
+
30
+ assert_equal 'monthly' , polls ( :draft ) . changefreq
31
+ assert_equal 'yearly' , diaries ( :old ) . changefreq
32
+ end
33
+ end
Original file line number Diff line number Diff line change
1
+ require 'test_helper'
2
+
3
+ class LangTest < ActiveSupport ::TestCase
4
+ setup do
5
+ $redis. del 'lang'
6
+ $redis. del 'lang/fr'
7
+ end
8
+
9
+ test 'should have no language' do
10
+ assert_empty Lang . all
11
+ end
12
+
13
+ test 'should add one language' do
14
+ Lang [ 'fr' ] = 'Français'
15
+
16
+ assert_not_empty Lang . all
17
+ assert 1 , Lang . all . size
18
+ end
19
+ end
You can’t perform that action at this time.
0 commit comments