Sha256: 31da526b29903bab6908616f20e388eaafe19e6739416c11cb4f0a617717be6e

Contents?: true

Size: 1.27 KB

Versions: 15

Compression:

Stored size: 1.27 KB

Contents

require 'test_helper'

class Admin::PageTemplatesControllerTest < ActionController::TestCase
  def test_index
    get :index
    assert_template 'index'
  end

  def test_show
    get :show, :id => PageTemplate.first
    assert_template 'show'
  end

  def test_new
    get :new
    assert_template 'new'
  end

  def test_create_invalid
    PageTemplate.any_instance.stubs(:valid?).returns(false)
    post :create
    assert_template 'new'
  end

  def test_create_valid
    PageTemplate.any_instance.stubs(:valid?).returns(true)
    post :create
    assert_redirected_to admin_page_template_url(assigns(:page_template))
  end

  def test_edit
    get :edit, :id => PageTemplate.first
    assert_template 'edit'
  end

  def test_update_invalid
    PageTemplate.any_instance.stubs(:valid?).returns(false)
    put :update, :id => PageTemplate.first
    assert_template 'edit'
  end

  def test_update_valid
    PageTemplate.any_instance.stubs(:valid?).returns(true)
    put :update, :id => PageTemplate.first
    assert_redirected_to admin_page_template_url(assigns(:page_template))
  end

  def test_destroy
    page_template = PageTemplate.first
    delete :destroy, :id => page_template
    assert_redirected_to admin_page_templates_url
    assert !PageTemplate.exists?(page_template.id)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kit_cms-2.3.22 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.20 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.19 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.18 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.17 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.16 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.15 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.14 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.13 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.11 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.10 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.9 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.8 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.7 test/functional/admin/page_templates_controller_test.rb
kit_cms-2.3.6 test/functional/admin/page_templates_controller_test.rb