Sha256: e0462cafd9c08ba4d799ff11022296dd395180cf4639cc2537958be0a5b3a030

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

require 'test_helper'

module Wafflemix
  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: { ancestry: @category.ancestry, categorical: @category.categorical, name: @category.name, position: @category.position }
      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
      put :update, id: @category, category: { ancestry: @category.ancestry, categorical: @category.categorical, name: @category.name, position: @category.position }
      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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wafflemix-0.0.6 test/functional/wafflemix/categories_controller_test.rb
wafflemix-0.0.5 test/functional/wafflemix/categories_controller_test.rb
wafflemix-0.0.4 test/functional/wafflemix/categories_controller_test.rb
wafflemix-0.0.3 test/functional/wafflemix/categories_controller_test.rb
wafflemix-0.0.2 test/functional/wafflemix/categories_controller_test.rb
wafflemix-0.0.1 test/functional/wafflemix/categories_controller_test.rb