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