Sha256: 332519a751f9589ee03f0d8b8b3fc7a3b574d990ce3360c7ae02017c461e4721

Contents?: true

Size: 1.8 KB

Versions: 45

Compression:

Stored size: 1.8 KB

Contents

require 'test_helper'

module Kaui
  class TagDefinitionsControllerTest < ActionController::TestCase
    fixtures :tag_definitions

    setup do
      @tag_definition = TagDefinition.new(tag_definitions(:payment_plan))
      @routes = Kaui::Engine.routes
    end

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

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

    test "should create tag_definition" do
      assert_difference('TagDefinition.count') do
        post :create, :tag_definition => { :description => @tag_definition.description, :name => @tag_definition.name }
      end

      # TODO - for now, we redirect to the main page as we don't get the id back
      assert_redirected_to tag_definitions_path
      # assert_redirected_to tag_definition_path(assigns(:tag_definition))
    end

    test "should show tag_definition" do
      get :show, :id => @tag_definition
      assert_response :success
    end

    test "should get edit" do
      get :edit, :id => @tag_definition
      assert_response :success
    end

    # TODO - not supported yet
    # test "should update tag_definition" do
    #   put :update, id: @tag_definition, tag_definition: { description: @tag_definition.description, id: @tag_definition.id, name: @tag_definition.name }
    #   assert_redirected_to tag_definition_path(assigns(:tag_definition))
    # end

    test "should destroy tag_definition" do
      post :create, :tag_definition => { :description => @tag_definition.description, :name => @tag_definition.name }
      new_id = assigns(:tag_definition).id

      assert_difference('TagDefinition.count', -1) do
        delete :destroy, :id => new_id
      end

      assert_redirected_to tag_definitions_path
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
kaui-0.6.6 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.6.5 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.6.4 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.6.3 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.6.2 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.6.1 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.6.0 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.5.3 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.5.2 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.5.1 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.5.0 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.9 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.8 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.7 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.6 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.5 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.4 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.3 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.2 test/functional/kaui/tag_definitions_controller_test.rb
kaui-0.4.1 test/functional/kaui/tag_definitions_controller_test.rb