Sha256: b91f59975d2ac838bb01288a0cbb91047ea062b3a3d84587eb042030479afadd
Contents?: true
Size: 1.73 KB
Versions: 11
Compression:
Stored size: 1.73 KB
Contents
require 'test_helper' module PagesCms class Admin::PagesControllerTest < ActionController::TestCase setup do @routes = Engine.routes session[:current_account] = pages_cms_accounts(:one).id end test 'should get index' do get :index assert_response :success end test 'get account of current page' do assert_not_equal pages_cms_pages(:one).account, nil end test 'should get edit' do get(:edit, {'id' => pages_cms_pages(:one).id}, {'current_account' => pages_cms_accounts(:one).id}) assert_response :success end test 'page create test' do page = { title: 'test page', meta_tags: 'tags', meta_description: 'some description', navbar_show: true, sidebar_show: true, draft: true, sidebar_attributes: { content: 'something', show: true }, page_blocks_attributes: { 0 => { name: 'something', div_id: 'some thing', blog_feeds_attributes: { 0 => { limit: 10 } }, text_boxes_attributes: { 0 => { content: '<p>a paragraph</p>' } }, image_boxes_attributes: { 0 => { heading: '<p>a paragraph</p>' } }, thumbnails_attributes: { 0 => { image_id: 1, link: '/thing' } } } } } assert_difference 'Page.count', +1 do assert_difference 'BlogFeed.count', +1 do assert_difference 'ImageBox.count', +1 do assert_difference 'TextBox.count', +1 do assert_difference 'Sidebar.count', +1 do assert_difference 'Thumbnail.count', +1 do post :create, page: page end end end end end end assert_response :redirect end end end
Version data entries
11 entries across 11 versions & 1 rubygems