fixing #99
Oleg
committed Sep 30, 2011
commit 0c7391e5e2698c00de58f19c002b436f9b9696bb
Showing 2
changed files with
6 additions
and 1 deletions
comfortable_mexican_sofa/view_methods.rb b/lib/comfortable_mexican_sofa/view_methods.rb
+1
-1
| @@ | @@ -25,7 +25,7 @@ module ComfortableMexicanSofa::ViewMethods |
| else | |
| return '' unless snippet = cms_site.snippets.find_by_slug(snippet_slug) | |
| end | |
| - | render :inline => ComfortableMexicanSofa::Tag.process_content(Cms::Page.new, snippet.content) |
| + | render :inline => ComfortableMexicanSofa::Tag.process_content(cms_site.pages.build, snippet.content) |
| end | |
| # Content of a page block. This is how you get content from page:field | |
test/unit/view_methods_test.rb
+5
-0
| @@ | @@ -28,6 +28,11 @@ class ViewMethodsTest < ActionView::TestCase |
| assert_equal 'hello', action_result('test_cms_snippet_content') | |
| end | |
| + | def test_cms_snippet_content_with_file_tag |
| + | cms_snippets(:default).update_attribute(:content, '{{cms:file:sample.jpg}}') |
| + | assert_equal cms_files(:default).file.url, action_result('test_cms_snippet_content') |
| + | end |
| + | |
| def test_cms_page_content | |
| assert_equal 'default_field_text_content', action_result('test_cms_page_content') | |
| end | |