require 'test_helper' class Admin::ReportsControllerTest < ActionController::TestCase tests Admin::ReportsController should 'get to #index' do get :index assert_response :success end should 'get to #new with report type' do get :new assert_response :success end should 'post to create' do assert_difference("Report.count") do post :create, "report" => { "type" => "BasicReport", "from_date(1i)" => "2014", "from_date(2i)" => "7", "from_date(3i)" => "17", "from_date(4i)" => "13", "from_date(5i)" => "39", "to_date(1i)" => "2014", "to_date(2i)" => "7", "to_date(3i)" => "17", "to_date(4i)" => "13", "to_date(5i)" => "39" } end end end