Sha256: 97d4f8e38c99ce1b5a813d318d600f5b0603f593e06800a9d2dcd3ba367b5165

Contents?: true

Size: 1.76 KB

Versions: 2

Compression:

Stored size: 1.76 KB

Contents

require 'test_helper'

module EasyReports
  class DatabaseConfigsControllerTest < ActionController::TestCase
    setup do
      @database_config = database_configs(:one)
    end

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

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

    test "should create database_config" do
      assert_difference('DatabaseConfig.count') do
        post :create, database_config: { adapter: @database_config.adapter, database: @database_config.database, encoding: @database_config.encoding, host: @database_config.host, password: @database_config.password, pool: @database_config.pool, username: @database_config.username }
      end

      assert_redirected_to database_config_path(assigns(:database_config))
    end

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

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

    test "should update database_config" do
      patch :update, id: @database_config, database_config: { adapter: @database_config.adapter, database: @database_config.database, encoding: @database_config.encoding, host: @database_config.host, password: @database_config.password, pool: @database_config.pool, username: @database_config.username }
      assert_redirected_to database_config_path(assigns(:database_config))
    end

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

      assert_redirected_to database_configs_path
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
easy_reports-0.0.25 test/controllers/easy_reports/database_configs_controller_test.rb
easy_reports-0.0.24 test/controllers/easy_reports/database_configs_controller_test.rb