Sha256: 10a51ee8ad88ce8d764631552cdc3f5c5c0e717185c5fdf239057810c1ca67c1

Contents?: true

Size: 1.37 KB

Versions: 15

Compression:

Stored size: 1.37 KB

Contents

require 'test_helper'

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

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

  def test_new
    get :new
    assert_template 'new'
  end

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

  def test_create_valid
    Admin::FormFieldType.any_instance.stubs(:valid?).returns(true)
    post :create
    assert_redirected_to admin_form_field_type_url(assigns(:form_field_type))
  end

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

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

  def test_update_valid
    Admin::FormFieldType.any_instance.stubs(:valid?).returns(true)
    put :update, :id => Admin::FormFieldType.first
    assert_redirected_to admin_form_field_type_url(assigns(:form_field_type))
  end

  def test_destroy
    form_field_type = Admin::FormFieldType.first
    delete :destroy, :id => form_field_type
    assert_redirected_to admin_form_field_types_url
    assert !Admin::FormFieldType.exists?(form_field_type.id)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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