Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 2297 Bytes
1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | |
3 | require 'http_mock' |
4 | |
5 | class ArticleTest < Test::Unit::TestCase |
6 | fixtures :articles, :settings |
7 | |
8 | def setup |
9 | config.reload |
10 | end |
11 | |
12 | def test_permalink |
13 | assert_equal @article1, Article.find_by_date(2005,11,01) |
14 | assert_equal @article3, Article.find_by_date(2004,06,01) |
15 | assert_equal [@article1, @article2], Article.find_all_by_date(2005) |
16 | end |
17 | |
18 | def test_permalink_with_title |
19 | assert_equal @article2, Article.find_by_permalink(2005, 11, 01, "article-2") |
20 | assert_nil Article.find_by_permalink(2005, 06, 01, "article-5") |
21 | end |
22 | |
23 | def test_strip_title |
24 | assert_equal "article-3", "Article-3".to_url |
25 | assert_equal "article-3", "Article 3!?#".to_url |
26 | assert_equal "there-is-sex-in-my-violence", "There is Sex in my Violence!".to_url |
27 | assert_equal "article", "-article-".to_url |
28 | assert_equal "lorem-ipsum-dolor-sit-amet-consectetaur-adipisicing-elit", "Lorem ipsum dolor sit amet, consectetaur adipisicing elit".to_url |
29 | assert_equal "my-cats-best-friend", "My Cat's Best Friend".to_url |
30 | end |
31 | |
32 | def test_perma_title |
33 | assert_equal "article-1", @article1.stripped_title |
34 | assert_equal "article-2", @article2.stripped_title |
35 | assert_equal "article-3", @article3.stripped_title |
36 | end |
37 | |
38 | def test_send_pings |
39 | @article1.send_pings("example.com", "http://localhost/post/5?param=1") |
40 | ping = Net::HTTP.pings.first |
41 | assert_equal "localhost",ping.host |
42 | assert_equal 80, ping.port |
43 | assert_equal "/post/5?param=1", ping.query |
44 | assert_equal "title=Article%201!&excerpt=body&url=example.com&blog_name=test%20blog", ping.post_data |
45 | end |
46 | |
47 | |
48 | def test_send_multiple_pings |
49 | @article1.send_pings("example.com", ["http://localhost/post/5?param=1", "http://127.0.0.1/article/5"]) |
50 | ping = Net::HTTP.pings[0] |
51 | assert_equal "localhost",ping.host |
52 | assert_equal 80, ping.port |
53 | assert_equal "/post/5?param=1", ping.query |
54 | assert_equal "title=Article%201!&excerpt=body&url=example.com&blog_name=test%20blog", ping.post_data |
55 | |
56 | ping = Net::HTTP.pings[1] |
57 | assert_equal "127.0.0.1",ping.host |
58 | assert_equal 80, ping.port |
59 | assert_equal "/article/5?", ping.query |
60 | assert_equal "title=Article%201!&excerpt=body&url=example.com&blog_name=test%20blog", ping.post_data |
61 | end |
62 | |
63 | end |