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