Sha256: 2b42575bff08d69f9d6a04d2334b41684e908a357c2e8fad13c4c2c4c2499354

Contents?: true

Size: 1.94 KB

Versions: 22

Compression:

Stored size: 1.94 KB

Contents

require 'test_helper'

class ModelsController < ApplicationController;  end

class ActionControllerTest < MiniTestSpecRails::TestCase

  it 'resolves spec type for matching acceptance strings' do
    assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptanceTest")
    assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance Test")
    # And is case sensitive
    refute_dispatch MiniTest::Spec.spec_type("widgetacceptancetest")
    refute_dispatch MiniTest::Spec.spec_type("widget acceptance test")
  end

  it 'wont match spec type for space characters in acceptance strings' do
    refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\tTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\rTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\nTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget Acceptance\fTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget AcceptanceXTest")
  end

  it 'resolves spec type for matching integration strings' do
    assert_dispatch MiniTest::Spec.spec_type("WidgetIntegrationTest")
    assert_dispatch MiniTest::Spec.spec_type("Widget Integration Test")
    # And is case sensitive
    refute_dispatch MiniTest::Spec.spec_type("widgetintegrationtest")
    refute_dispatch MiniTest::Spec.spec_type("widget integration test")
  end

  it 'wont match spec type for space characters in integration strings' do
    refute_dispatch MiniTest::Spec.spec_type("Widget Integration\tTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget Integration\rTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget Integration\nTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget Integration\fTest")
    refute_dispatch MiniTest::Spec.spec_type("Widget IntegrationXTest")
  end


  private

  def assert_dispatch(actual)
    assert_equal ActionDispatch::IntegrationTest, actual
  end

  def refute_dispatch(actual)
    refute_equal ActionDispatch::IntegrationTest, actual
  end

end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
minitest-spec-rails-4.7.11 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.4.0 test/cases/action_dispatch_test.rb
minitest-spec-rails-4.7.10 test/cases/action_dispatch_test.rb
minitest-spec-rails-4.7.9 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.3.0 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.2.2 test/cases/action_dispatch_test.rb
minitest-spec-rails-4.7.8 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.2.0 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.1.1 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.1.0 test/cases/action_dispatch_test.rb
minitest-spec-rails-orangejulius-5.0.5.pre.orangejulius test/cases/action_dispatch_test.rb
minitest-spec-rails-orangejulius-5.0.4.pre.orangejulius test/cases/action_dispatch_test.rb
minitest-spec-rails-4.7.7 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.0.4 test/cases/action_dispatch_test.rb
minitest-spec-rails-orangejulius-5.0.3.pre.orangejulius test/cases/action_dispatch_test.rb
minitest-spec-rails-5.0.3 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.0.2 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.0.1 test/cases/action_dispatch_test.rb
minitest-spec-rails-4.7.6 test/cases/action_dispatch_test.rb
minitest-spec-rails-5.0.0 test/cases/action_dispatch_test.rb