public
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/halorgium/mephisto.git
fixed some test issues

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2288 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Sep 26 22:03:06 -0700 2006
commit  acafd48278873ed10abcd89f0f8ae9c463425cf6
tree    cfb69f018c251f82fdd5894a2aa4750b35db428c
parent  5ffddb452cd18eb14296896c05a977eaffcf2c66
...
83
84
85
86
 
87
88
89
...
83
84
85
 
86
87
88
89
0
@@ -83,7 +83,7 @@ class MephistoController < ApplicationController
0
     def dispatch_search
0
       conditions = ['(published_at IS NOT NULL AND published_at <= :now) AND (title LIKE :q OR excerpt LIKE :q OR body LIKE :q)',
0
                        { :now => Time.now.utc, :q => "%#{params[:q]}%" }]
0
- search_count = site.articles.count(conditions)
0
+ search_count = site.articles.count(:all, :conditions => conditions)
0
       @article_pages = Paginator.new self, search_count, site.articles_per_page, params[:page]
0
       @articles = site.articles.find(:all, :conditions => conditions, :order => 'published_at DESC',
0
                          :include => [:user, :sections],
...
8
9
10
11
12
13
 
 
 
14
15
16
...
28
29
30
31
32
33
 
 
 
34
35
36
...
8
9
10
 
 
 
11
12
13
14
15
16
...
28
29
30
 
 
 
31
32
33
34
35
36
0
@@ -8,9 +8,9 @@ welcome_1:
0
   excerpt_html: welcome summary
0
   body: welcome description
0
   body_html: welcome description
0
- created_at: <%= 5.days.ago.to_s(:db) %>
0
- updated_at: <%= 5.days.ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ updated_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   comment_age: 30
0
   user_id: 1
0
   comments_count: 1
0
@@ -28,9 +28,9 @@ welcome_2:
0
   excerpt_html: welcome summary
0
   body: welcome description
0
   body_html: welcome description
0
- created_at: <%= 5.days.ago.to_s(:db) %>
0
- updated_at: <%= 5.days.ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ updated_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   comment_age: 30
0
   user_id: 1
0
   comments_count: 1
...
14
15
16
17
18
19
 
 
 
20
21
22
...
31
32
33
34
35
36
 
 
 
37
38
39
...
45
46
47
48
49
50
 
 
 
51
52
53
...
61
62
63
64
65
 
 
66
67
68
...
76
77
78
79
80
81
 
 
 
82
83
84
...
91
92
93
94
95
96
 
 
 
97
98
99
...
106
107
108
109
110
111
 
 
 
112
113
114
...
121
122
123
124
125
126
 
 
 
127
128
129
...
135
136
137
138
139
140
 
 
 
141
142
143
...
148
149
150
151
152
 
 
153
154
155
156
...
14
15
16
 
 
 
17
18
19
20
21
22
...
31
32
33
 
 
 
34
35
36
37
38
39
...
45
46
47
 
 
 
48
49
50
51
52
53
...
61
62
63
 
 
64
65
66
67
68
...
76
77
78
 
 
 
79
80
81
82
83
84
...
91
92
93
 
 
 
94
95
96
97
98
99
...
106
107
108
 
 
 
109
110
111
112
113
114
...
121
122
123
 
 
 
124
125
126
127
128
129
...
135
136
137
 
 
 
138
139
140
141
142
143
...
148
149
150
 
 
151
152
153
154
155
156
0
@@ -14,9 +14,9 @@ welcome:
0
   excerpt_html: welcome summary
0
   body: "quentin's \"welcome\" *description* <script>hi</script><a onclick=\"foo\" href=\"#\">linkage</a>"
0
   body_html: "<p>quentin&#8217;s &#8220;welcome&#8221; <strong>description</strong> <script>hi</script><a onclick=\"foo\" href=\"#\">linkage</a></p>"
0
- created_at: <%= 5.days.ago.to_s(:db) %>
0
- updated_at: <%= 5.days.ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ updated_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   comment_age: 30
0
   user_id: 1
0
   comments_count: 1
0
@@ -31,9 +31,9 @@ another:
0
   permalink: another-welcome-to-mephisto
0
   body: another welcome description
0
   body_html: another welcome description
0
- created_at: <%= 4.days.ago.to_s(:db) %>
0
- updated_at: <%= 4.days.ago.to_s(:db) %>
0
- published_at: <%= 4.days.ago.to_s(:db) %>
0
+ created_at: <%= 4.days.ago.utc.to_s(:db) %>
0
+ updated_at: <%= 4.days.ago.utc.to_s(:db) %>
0
+ published_at: <%= 4.days.ago.utc.to_s(:db) %>
0
   comment_age: 1
0
   user_id: 3
0
   type: Article
0
@@ -45,9 +45,9 @@ welcome_comment:
0
   permalink: welcome-to-mephisto
0
   body: "rico's evil <script>hi</script> and <a onclick=\"foo\" href=\"#\">linkage</a>"
0
   body_html: "<p>rico&#8217;s evil <script>hi</script> and <a onclick=\"foo\" href=\"#\">linkage</a></p>"
0
- created_at: <%= (3.days + 55.minutes).ago.to_s(:db) %>
0
- updated_at: <%= (3.days + 55.minutes).ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= (3.days + 55.minutes).ago.utc.to_s(:db) %>
0
+ updated_at: <%= (3.days + 55.minutes).ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   type: Comment
0
   author: rico
0
   author_ip: 1dfasd
0
@@ -61,8 +61,8 @@ future:
0
   permalink: article-in-the-future
0
   excerpt: This is my own little blogging tool
0
   excerpt_html: This is my own little blogging tool
0
- created_at: <%= (4.days - 15.minutes).ago.to_s(:db) %>
0
- updated_at: <%= (4.days - 15.minutes).ago.to_s(:db) %>
0
+ created_at: <%= (4.days - 15.minutes).ago.utc.to_s(:db) %>
0
+ updated_at: <%= (4.days - 15.minutes).ago.utc.to_s(:db) %>
0
   published_at: <%= (4.days - 15.minutes).from_now.to_s(:db) %>
0
   comment_age: 30
0
   user_id: 1
0
@@ -76,9 +76,9 @@ about:
0
   excerpt_html: This is my own about page
0
   body: This is my own about page
0
   body_html: This is my own about page
0
- created_at: <%= (4.days - 13.minutes).ago.to_s(:db) %>
0
- updated_at: <%= (4.days - 13.minutes).ago.to_s(:db) %>
0
- published_at: <%= (4.days - 13.minutes).ago.to_s(:db) %>
0
+ created_at: <%= (4.days - 13.minutes).ago.utc.to_s(:db) %>
0
+ updated_at: <%= (4.days - 13.minutes).ago.utc.to_s(:db) %>
0
+ published_at: <%= (4.days - 13.minutes).ago.utc.to_s(:db) %>
0
   comment_age: 2
0
   user_id: 1
0
   type: Article
0
@@ -91,9 +91,9 @@ site_map:
0
   excerpt_html: This is my own site map
0
   body: This is my own site map
0
   body_html: This is my own site map
0
- created_at: <%= (4.days - 5.minutes).ago.to_s(:db) %>
0
- updated_at: <%= (4.days - 5.minutes).ago.to_s(:db) %>
0
- published_at: <%= (4.days - 5.minutes).ago.to_s(:db) %>
0
+ created_at: <%= (4.days - 5.minutes).ago.utc.to_s(:db) %>
0
+ updated_at: <%= (4.days - 5.minutes).ago.utc.to_s(:db) %>
0
+ published_at: <%= (4.days - 5.minutes).ago.utc.to_s(:db) %>
0
   comment_age: -1
0
   user_id: 1
0
   type: Article
0
@@ -106,9 +106,9 @@ cupcake_welcome:
0
   excerpt_html: welcome summary
0
   body: welcome description
0
   body_html: welcome description
0
- created_at: <%= 5.days.ago.to_s(:db) %>
0
- updated_at: <%= 5.days.ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ updated_at: <%= 5.days.ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   comment_age: 30
0
   user_id: 1
0
   comments_count: 1
0
@@ -121,9 +121,9 @@ cupcake_welcome_comment:
0
   permalink: welcome-to-cupcake
0
   body: This blogging tool tastes like fudge.
0
   body_html: This blogging tool tastes like fudge.
0
- created_at: <%= (3.days + 55.minutes).ago.to_s(:db) %>
0
- updated_at: <%= (3.days + 55.minutes).ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= (3.days + 55.minutes).ago.utc.to_s(:db) %>
0
+ updated_at: <%= (3.days + 55.minutes).ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   type: Comment
0
   author: rico
0
   approved: true
0
@@ -135,9 +135,9 @@ unwelcome_comment:
0
   permalink: welcome-to-mephisto
0
   body: This blogging tool sucks.
0
   body_html: This blogging tool sucks.
0
- created_at: <%= (2.days + 55.minutes).ago.to_s(:db) %>
0
- updated_at: <%= (2.days + 55.minutes).ago.to_s(:db) %>
0
- published_at: <%= 3.days.ago.to_s(:db) %>
0
+ created_at: <%= (2.days + 55.minutes).ago.utc.to_s(:db) %>
0
+ updated_at: <%= (2.days + 55.minutes).ago.utc.to_s(:db) %>
0
+ published_at: <%= 3.days.ago.utc.to_s(:db) %>
0
   type: Comment
0
   author: rico
0
   author_ip: '127.0.0.1'
0
@@ -148,8 +148,8 @@ draft:
0
   permalink: test-draft
0
   body: This is a test draft
0
   body_html: This is a test draft
0
- created_at: <%= 1.day.ago.to_s(:db) %>
0
- updated_at: <%= 1.day.ago.to_s(:db) %>
0
+ created_at: <%= 1.day.ago.utc.to_s(:db) %>
0
+ updated_at: <%= 1.day.ago.utc.to_s(:db) %>
0
   comment_age: 30
0
   user_id: 1
0
   type: Article
0
\ No newline at end of file
...
37
38
39
40
 
 
 
 
41
42
43
...
48
49
50
51
 
 
 
 
52
53
54
...
37
38
39
 
40
41
42
43
44
45
46
...
51
52
53
 
54
55
56
57
58
59
60
0
@@ -37,7 +37,10 @@ class Admin::ResourcesControllerTest < Test::Unit::TestCase
0
     get :edit
0
     assert_redirected_to :action => 'index'
0
     assert flash[:error]
0
-
0
+ end
0
+
0
+ def test_should_require_resource_id_on_update
0
+ login_as :quentin
0
     get :update
0
     assert_redirected_to :action => 'index'
0
     assert flash[:error]
0
@@ -48,7 +51,10 @@ class Admin::ResourcesControllerTest < Test::Unit::TestCase
0
     get :update, :filename => 'style.css', :data => 'foo'
0
     assert_redirected_to :action => 'edit'
0
     assert flash[:error]
0
-
0
+ end
0
+
0
+ def test_should_require_posted_resource_on_update
0
+ login_as :quentin
0
     post :update, :filename => 'style.css'
0
     assert_redirected_to :action => 'edit'
0
     assert flash[:error]
...
33
34
35
36
 
37
38
39
40
41
 
 
 
 
42
43
44
45
46
47
 
48
49
50
51
52
 
 
 
 
53
54
55
...
33
34
35
 
36
37
38
39
40
 
41
42
43
44
45
46
47
48
49
 
50
51
52
53
54
 
55
56
57
58
59
60
61
0
@@ -33,23 +33,29 @@ class Admin::TemplatesControllerTest < Test::Unit::TestCase
0
     assert_tag :tag => 'textarea', :attributes => { :id => 'data' }
0
   end
0
 
0
- def test_should_require_template_filename
0
+ def test_should_require_template_filename_on_edit
0
     login_as :quentin
0
     get :edit
0
     assert_redirected_to :action => 'index'
0
     assert flash[:error]
0
-
0
+ end
0
+
0
+ def test_should_require_template_filename_on_update
0
+ login_as :quentin
0
     get :update
0
     assert_redirected_to :action => 'index'
0
     assert flash[:error]
0
   end
0
 
0
- def test_should_require_posted_template
0
+ def test_should_require_post_on_update
0
     login_as :quentin
0
     get :update, :filename => 'layout.liquid'
0
     assert_redirected_to :action => 'edit'
0
     assert flash[:error]
0
-
0
+ end
0
+
0
+ def test_should_require_posted_template
0
+ login_as :quentin
0
     post :update, :filename => 'layout.liquid'
0
     assert_redirected_to :action => 'edit'
0
     assert flash[:error]
...
19
20
21
22
 
23
24
25
...
19
20
21
 
22
23
24
25
0
@@ -19,7 +19,7 @@ class ArticleTest < Test::Unit::TestCase
0
   end
0
 
0
   def test_full_permalink
0
- date = 3.days.ago
0
+ date = 3.days.ago.utc
0
     assert_equal ['', date.year, date.month, date.day, 'welcome-to-mephisto'].join('/'), contents(:welcome).full_permalink
0
   end
0
 

Comments

    No one has commented yet.