Sha256: c208bc27b1997959a1e6edbe8e3cf5dfd755430bf89dc6c56b5dd2fccd092f74

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 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: @category.attributes
    end

    assert_redirected_to category_path(assigns(:category))
  end

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

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

  test "should update category" do
    put :update, id: @category.to_param, category: @category.attributes
    assert_redirected_to category_path(assigns(:category))
  end

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

    assert_redirected_to categories_path
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blogmodule-1.0.2 test/functional/categories_controller_test.rb
blogmodule-1.0.1 test/functional/categories_controller_test.rb
blogmodule-1.0.0 test/functional/categories_controller_test.rb
blogmodule-0.0.1 test/functional/categories_controller_test.rb