Sha256: ba894fba4005e3246484d20648e6b304f739d73e9e82412dbae43e5d1c2e4f71

Contents?: true

Size: 1.34 KB

Versions: 27

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

module Notee
  class CategoriesControllerTest < ActionController::TestCase
    setup do
      @category = notee_categories(:one)
      @routes = Engine.routes
    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: { name: @category.name, parent_id: @category.parent_id, slug: @category.slug, status: @category.status }
      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 :notee, id: @category
      assert_response :success
    end

    test "should update category" do
      patch :update, id: @category, category: { name: @category.name, parent_id: @category.parent_id, slug: @category.slug, status: @category.status }
      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

27 entries across 27 versions & 1 rubygems

Version Path
notee-1.0.7 test/controllers/notee/categories_controller_test.rb
notee-1.0.6 test/controllers/notee/categories_controller_test.rb
notee-1.0.5 test/controllers/notee/categories_controller_test.rb
notee-1.0.4 test/controllers/notee/categories_controller_test.rb
notee-1.0.3 test/controllers/notee/categories_controller_test.rb
notee-1.0.2 test/controllers/notee/categories_controller_test.rb
notee-1.0.1 test/controllers/notee/categories_controller_test.rb
notee-1.0.0 test/controllers/notee/categories_controller_test.rb
notee-0.4.0 test/controllers/notee/categories_controller_test.rb
notee-0.3.7 test/controllers/notee/categories_controller_test.rb
notee-0.3.6 test/controllers/notee/categories_controller_test.rb
notee-0.3.5 test/controllers/notee/categories_controller_test.rb
notee-0.3.4.1 test/controllers/notee/categories_controller_test.rb
notee-0.3.4 test/controllers/notee/categories_controller_test.rb
notee-0.3.3 test/controllers/notee/categories_controller_test.rb
notee-0.3.2 test/controllers/notee/categories_controller_test.rb
notee-0.3.1 test/controllers/notee/categories_controller_test.rb
notee-0.3.0 test/controllers/notee/categories_controller_test.rb
notee-0.2.9 test/controllers/notee/categories_controller_test.rb
notee-0.2.8 test/controllers/notee/categories_controller_test.rb