Permalink
Browse files

Define ReverseFilter in PageSpec so we can test rendering with it

  • Loading branch information...
1 parent e429141 commit 7ab7bb46897236ee0fa0eb90c576f4829eee67ff @jomz jomz committed Feb 13, 2014
Showing with 8 additions and 1 deletion.
  1. +8 −1 spec/models/page_spec.rb
View
9 spec/models/page_spec.rb
@@ -30,6 +30,13 @@ def virtual?
end
end
+class ReverseFilter < TextFilter
+ description %{Reverses text.}
+ def filter(text)
+ text.reverse
+ end
+end
+
describe Page, 'validations' do
test_helper :page
@@ -469,7 +476,7 @@ def virtual?
end
it 'should render with a filter' do
- pages(:textile).render.should == 'Some *Textile* content. - Filtered with TEXTILE!'
+ reverse_filtered.render.should == '!dlrow olleH'
end
it 'should render with tags' do

0 comments on commit 7ab7bb4

Please sign in to comment.