Sha256: d624ffb6e64179ff1a6ea623013230934516c96b644e741ce5a6d7864f5744ed

Contents?: true

Size: 1004 Bytes

Versions: 5

Compression:

Stored size: 1004 Bytes

Contents

require 'test_helper'

class AdminsControllerTest < ActionController::TestCase
  setup do
    @admin = admins(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:admins)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create admin" do
    assert_difference('Admin.count') do
      post :create, admin: { name: @admin.name }
    end

    assert_redirected_to admin_path(assigns(:admin))
  end

  test "should show admin" do
    get :show, id: @admin
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @admin
    assert_response :success
  end

  test "should update admin" do
    put :update, id: @admin, admin: { name: @admin.name }
    assert_redirected_to admin_path(assigns(:admin))
  end

  test "should destroy admin" do
    assert_difference('Admin.count', -1) do
      delete :destroy, id: @admin
    end

    assert_redirected_to admins_path
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cardboard_cms-0.2.2 test/dummy/test/functional/admins_controller_test.rb
cardboard_cms-0.2.1 test/dummy/test/functional/admins_controller_test.rb
cardboard_cms-0.1.8 test/dummy/test/functional/admins_controller_test.rb
cardboard_cms-0.1.6 test/dummy/test/functional/admins_controller_test.rb
cardboard_cms-0.1.4 test/dummy/test/functional/admins_controller_test.rb