Sha256: 60fffbea21d86c144c9cfd62dc3ba182260177c272a1f0c2cd3c4e5f2ff05f35

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

require 'test_helper'

class CategoriesControllerTest < ActionController::TestCase
  setup do
    @category = categories(:one)
  end

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

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

  test "should create category" do
    assert_difference('Category.count') do
      post :create, category: { title: @category.title }
    end

    assert_redirected_to category_path(assigns(:category))
  end

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

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

  test "should update category" do
    patch :update, id: @category, category: { title: @category.title }
    assert_redirected_to category_path(assigns(:category))
  end

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

    assert_redirected_to categories_path
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
adminish-0.0.1 test/dummy/test/controllers/categories_controller_test.rb
activeform-rails-0.0.5 spec/dummy/test/controllers/categories_controller_test.rb
activeform-rails-0.0.4 spec/dummy/test/controllers/categories_controller_test.rb
activeform-rails-0.0.3 spec/dummy/test/controllers/categories_controller_test.rb
activeform-rails-0.0.2 spec/dummy/test/controllers/categories_controller_test.rb
activeform-rails-0.0.1 spec/dummy/test/controllers/categories_controller_test.rb