Sha256: d2eb7b75e5766df9867114d88af15ff3ceb82f843253cdd2f54cccae5937e5a1

Contents?: true

Size: 863 Bytes

Versions: 10

Compression:

Stored size: 863 Bytes

Contents

require 'test_helper'

class ClarkKent::ReportColumnsControllerTest < ControllerTest

  let(:report) {ClarkKent::Report.first}

  setup do
    @routes = ClarkKent::Engine.routes
  end

  it "should create a report column" do
    xhr :post, :create, params: {report_column: {report_id: report.id, column_name: 'user_name'}}
    assert_response :success
  end

  it "should reject a report column with no column_name" do
    xhr :post, :create, params: {report_column: {report_id: report.id}}
    assert_response :conflict
    @response.body.must_match /can[^t]*t be blank/
  end

  it "should reject a report column with unusable sort" do
    xhr :post, :create, params: {report_column: {report_id: report.id, column_name: 'user_name', report_sort: 'ascending'}}
    assert_response :conflict
    @response.body.must_match 'This column is not sortable.'
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clark_kent-0.9.1 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.9.0 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.11 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.10 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.9 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.8 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.7 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.6 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.5 test/controllers/clark_kent/report_columns_controller_test.rb
clark_kent-0.8.4 test/controllers/clark_kent/report_columns_controller_test.rb