public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
fix bug preventing plain html filter

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2463 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Mon Nov 13 07:38:28 -0800 2006
commit  f306c6d49793a3dc461437211263bb5a0618b997
tree    d525882d86c4679c503d7c4d71069e3466778d0b
parent  9cb5c1e617e1b2f15161c88cf70d9574cf56f008
...
127
128
129
130
 
131
132
133
...
127
128
129
 
130
131
132
133
0
@@ -127,7 +127,7 @@ class Article < Content
0
   end
0
 
0
   def set_default_filter_from(filtered_object)
0
- set_filter_from(filtered_object) if filter.blank?
0
+ set_filter_from(filtered_object) if filter.nil?
0
   end
0
 
0
   def set_default_filter!
...
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
...
174
175
176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
52
53
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
56
57
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
0
@@ -52,34 +52,6 @@ class ArticleTest < Test::Unit::TestCase
0
     assert_equal 'textile_filter', a.filter
0
   end
0
 
0
- def test_should_modify_filter
0
- assert_equal 'textile_filter', contents(:welcome).filter
0
-
0
- contents(:welcome).filter = 'markdown_filter'
0
- contents(:welcome).save
0
-
0
- assert_equal 'markdown_filter', contents(:welcome).reload.filter
0
- end
0
-
0
- def test_should_modify_filter_and_leave_comments_alone
0
- assert_equal 'textile_filter', contents(:welcome_comment).filter
0
- old_time = contents(:welcome_comment)
0
-
0
- contents(:welcome).filter = 'markdown_filter'
0
- contents(:welcome).save
0
-
0
- assert_equal 'textile_filter', contents(:welcome_comment).reload.filter
0
- end
0
-
0
- def test_should_modify_filter_and_not_modify_comment_timestamps
0
- old_time = contents(:welcome_comment).updated_at
0
-
0
- contents(:welcome).filter = 'markdown_filter'
0
- contents(:welcome).save
0
-
0
- assert_equal old_time, contents(:welcome_comment).reload.updated_at
0
- end
0
-
0
   def test_should_cache_bluecloth
0
     a = Article.create :title => 'simple Title', :user => users(:arthur), :body => "# bar\n\nfoo", :filter => 'markdown_filter', :site_id => 1
0
     assert_equal "<h1>bar</h1>\n\n<p>foo</p>", a.body_html
0
@@ -174,3 +146,32 @@ class ArticleTest < Test::Unit::TestCase
0
       end
0
     end
0
 end
0
+
0
+class ArticleFilterEditTest < Test::Unit::TestCase
0
+ fixtures :contents, :users, :sections, :sites
0
+
0
+ def setup
0
+ @old_time = contents(:welcome_comment).updated_at
0
+ assert_equal 'textile_filter', contents(:welcome).filter
0
+ contents(:welcome).filter = 'markdown_filter'
0
+ contents(:welcome).save!
0
+ end
0
+
0
+ def test_should_clear_filter
0
+ contents(:welcome).filter = ''
0
+ contents(:welcome).save!
0
+ assert_equal '', contents(:welcome).filter
0
+ end
0
+
0
+ def test_should_modify_filter
0
+ assert_equal 'markdown_filter', contents(:welcome).reload.filter
0
+ end
0
+
0
+ def test_should_modify_filter_and_leave_comments_alone
0
+ assert_equal 'textile_filter', contents(:welcome_comment).reload.filter
0
+ end
0
+
0
+ def test_should_modify_filter_and_not_modify_comment_timestamps
0
+ assert_equal @old_time, contents(:welcome_comment).reload.updated_at
0
+ end
0
+end

Comments

    No one has commented yet.