more assertions

Oleg committed Oct 03, 2011
commit ca429c2e0991435ad3c7df006b0873bcd156b988
Showing 2 changed files with 9 additions and 1 deletions
comfortable_mexican_sofa/render_methods.rb b/lib/comfortable_mexican_sofa/render_methods.rb +0 -1
@@ @@ -46,7 +46,6 @@ module ComfortableMexicanSofa::RenderMethods
if @cms_layout = @cms_site && @cms_site.layouts.find_by_slug(slug)
cms_app_layout = @cms_layout.try(:app_layout)
cms_page = @cms_site.pages.build(:layout => @cms_layout)
-
cms_blocks = options.delete(:cms_blocks) || { :content => render_to_string }
cms_blocks.each do |block_label, value|
content = if value.is_a?(Hash)
test/integration/render_cms_test.rb +9 -0
@@ @@ -138,6 +138,9 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
get '/render-layout?type=layout_defaults'
assert_response :success
assert_equal 'TestTemplate TestValue', response.body
+ assert assigns(:cms_site)
+ assert assigns(:cms_layout)
+ assert_equal cms_layouts(:default), assigns(:cms_layout)
end
def test_cms_layout
@@ @@ -145,12 +148,18 @@ class RenderCmsTest < ActionDispatch::IntegrationTest
get '/render-layout?type=layout'
assert_response :success
assert_equal 'TestText TestPartial TestValue TestTemplate TestValue', response.body
+ assert assigns(:cms_site)
+ assert assigns(:cms_layout)
+ assert_equal cms_layouts(:default), assigns(:cms_layout)
end
def test_cms_layout_with_status
get '/render-layout?type=layout_with_status'
assert_response 404
assert_equal 'TestTemplate TestValue', response.body
+ assert assigns(:cms_site)
+ assert assigns(:cms_layout)
+ assert_equal cms_layouts(:default), assigns(:cms_layout)
end
def test_cms_layout_failure