adjustment for partial paths

Oleg committed Sep 26, 2011
commit 535e0454dd6adae5e3e661138a6e06921c304a2b
Showing 4 changed files with 12 additions and 12 deletions
comfortable_mexican_sofa/tags/collection.rb b/lib/comfortable_mexican_sofa/tags/collection.rb +1 -1
@@ @@ -20,7 +20,7 @@ class ComfortableMexicanSofa::Tag::Collection
# Path to the partial. Example: `path/to/partial`
def collection_partial
- self.params[1] || self.collection_class.underscore.pluralize
+ self.params[1] || "partials/#{self.collection_class.underscore.pluralize}"
end
# Title method for the Collection objects. Default is `label`
test/functional/cms_admin/pages_controller_test.rb +2 -2
@@ @@ -49,7 +49,7 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
def test_get_new_with_field_datetime
cms_layouts(:default).update_attribute(:content, '{{cms:field:test_label:datetime}}')
get :new, :site_id => cms_sites(:default)
- assert_select "input[type='text'][name='page[blocks_attributes][][content]'][class='date']"
+ assert_select "input[type='text'][name='page[blocks_attributes][][content]'][class='datetime']"
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
end
@@ @@ -77,7 +77,7 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
def test_get_new_with_page_datetime
cms_layouts(:default).update_attribute(:content, '{{cms:page:test_label:datetime}}')
get :new, :site_id => cms_sites(:default)
- assert_select "input[type='text'][name='page[blocks_attributes][][content]'][class='date']"
+ assert_select "input[type='text'][name='page[blocks_attributes][][content]'][class='datetime']"
assert_select "input[type='hidden'][name='page[blocks_attributes][][label]'][value='test_label']"
end
test/unit/tag_test.rb +2 -2
@@ @@ -243,7 +243,7 @@ class TagTest < ActiveSupport::TestCase
:content => snippet.id }
]
)
- assert_equal "&lt;% 1 + 1 %&gt; text &lt;% 2 + 2 %&gt; snippet &lt;%= 2 + 2 %&gt; <%= render :partial => 'path/to' %> <%= method() %> text <%= render :partial => 'cms/snippets', :locals => {:model => 'Cms::Snippet', :identifier => '#{snippet.id}'} %> &lt;%= 1 + 1 %&gt;", page.content
+ assert_equal "&lt;% 1 + 1 %&gt; text &lt;% 2 + 2 %&gt; snippet &lt;%= 2 + 2 %&gt; <%= render :partial => 'path/to' %> <%= method() %> text <%= render :partial => 'partials/cms/snippets', :locals => {:model => 'Cms::Snippet', :identifier => '#{snippet.id}'} %> &lt;%= 1 + 1 %&gt;", page.content
end
def test_content_with_irb_enabled
@@ @@ -269,7 +269,7 @@ class TagTest < ActiveSupport::TestCase
:content => snippet.id }
]
)
- assert_equal "<% 1 + 1 %> text <% 2 + 2 %> snippet <%= 2 + 2 %> <%= render :partial => 'path/to' %> <%= method() %> text <%= render :partial => 'cms/snippets', :locals => {:model => 'Cms::Snippet', :identifier => '#{snippet.id}'} %> <%= 1 + 1 %>", page.content
+ assert_equal "<% 1 + 1 %> text <% 2 + 2 %> snippet <%= 2 + 2 %> <%= render :partial => 'path/to' %> <%= method() %> text <%= render :partial => 'partials/cms/snippets', :locals => {:model => 'Cms::Snippet', :identifier => '#{snippet.id}'} %> <%= 1 + 1 %>", page.content
end
end
test/unit/tags/collection_test.rb +7 -7
@@ @@ -13,12 +13,12 @@ class CollectionTagTest < ActiveSupport::TestCase
assert tag = ComfortableMexicanSofa::Tag::Collection.initialize_tag(
cms_pages(:default), '{{ cms:collection:snippet:cms/snippet }}'
)
- assert_equal 'snippet', tag.label
- assert_equal 'Cms::Snippet', tag.collection_class
- assert_equal 'cms/snippets', tag.collection_partial
- assert_equal 'label', tag.collection_title
- assert_equal 'id', tag.collection_identifier
- assert_equal [], tag.collection_params
+ assert_equal 'snippet', tag.label
+ assert_equal 'Cms::Snippet', tag.collection_class
+ assert_equal 'partials/cms/snippets', tag.collection_partial
+ assert_equal 'label', tag.collection_title
+ assert_equal 'id', tag.collection_identifier
+ assert_equal [], tag.collection_params
end
def test_initialize_tag_detailed
@@ @@ -80,7 +80,7 @@ class CollectionTagTest < ActiveSupport::TestCase
tag.content = snippet.id
assert_equal snippet.id, tag.block.content
assert_equal snippet.id, tag.content
- assert_equal "<%= render :partial => 'cms/snippets', :locals => {:model => 'Cms::Snippet', :identifier => '#{snippet.id}'} %>", tag.render
+ assert_equal "<%= render :partial => 'partials/cms/snippets', :locals => {:model => 'Cms::Snippet', :identifier => '#{snippet.id}'} %>", tag.render
end
def test_content_and_render_detailed