Sha256: 2b215428994edd97a770661a20c808002e641dc197c498d6500ad3f8946bf351

Contents?: true

Size: 1.86 KB

Versions: 3

Compression:

Stored size: 1.86 KB

Contents

require 'test_helper'

class ModelsController < ApplicationController;  end

class ActionControllerTest < MiniTestSpecRails::TestCase

  it 'resolves spect type for matching acceptance strings' do
   assert_dispatch MiniTest::Spec.spec_type("WidgetAcceptanceTest")
   assert_dispatch MiniTest::Spec.spec_type("Widget Acceptance Test")
   assert_dispatch MiniTest::Spec.spec_type("widgetacceptancetest")
   assert_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")
   assert_dispatch MiniTest::Spec.spec_type("widgetintegrationtest")
   assert_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 ActionController::IntegrationTest, actual
  end

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

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minitest-spec-rails-3.1.2 test/cases/action_dispatch_test.rb
minitest-spec-rails-3.1.1 test/cases/action_dispatch_test.rb
minitest-spec-rails-3.1.0 test/cases/action_dispatch_test.rb