Sha256: 0e718a7d736c1ba7a7529dabd51419ba05c4969f9f6dbb63d4ec977ce3ad093a

Contents?: true

Size: 1.17 KB

Versions: 16

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

module EasyReports
  class ReportsControllerTest < ActionController::TestCase
    setup do
      @report = reports(:one)
    end

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

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

    test "should create report" do
      assert_difference('Report.count') do
        post :create, report: { description: @report.description, title: @report.title }
      end

      assert_redirected_to report_path(assigns(:report))
    end

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

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

    test "should update report" do
      patch :update, id: @report, report: { description: @report.description, title: @report.title }
      assert_redirected_to report_path(assigns(:report))
    end

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

      assert_redirected_to reports_path
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
easy_reports-0.0.22 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.21 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.20 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.19 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.18 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.17 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.16 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.15 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.14 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.13 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.11 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.10 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.9 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.8 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.7 test/controllers/easy_reports/reports_controller_test.rb
easy_reports-0.0.6 test/controllers/easy_reports/reports_controller_test.rb