Sha256: 0dec967d3b34fcce0af4c3085ecff6196d7ee0db2ad6f2b6d1e0b905f70e6428

Contents?: true

Size: 1.49 KB

Versions: 22

Compression:

Stored size: 1.49 KB

Contents

require 'test_helper'

class ActionViewTest < MiniTestSpecRails::TestCase

  it 'resolves spec type for matching helper strings' do
    assert_view MiniTest::Spec.spec_type("WidgetHelper")
    assert_view MiniTest::Spec.spec_type("WidgetHelperTest")
    assert_view MiniTest::Spec.spec_type("Widget Helper Test")
    # And is case sensitive
    refute_view MiniTest::Spec.spec_type("widgethelper")
    refute_view MiniTest::Spec.spec_type("widgethelpertest")
    refute_view MiniTest::Spec.spec_type("widget helper test")
  end

  it 'resolves spec type for matching view strings' do
    assert_view MiniTest::Spec.spec_type("WidgetView")
    assert_view MiniTest::Spec.spec_type("WidgetViewTest")
    assert_view MiniTest::Spec.spec_type("Widget View Test")
    # And is case sensitive
    refute_view MiniTest::Spec.spec_type("widgetview")
    refute_view MiniTest::Spec.spec_type("widgetviewtest")
    refute_view MiniTest::Spec.spec_type("widget view test")
  end

  it 'wont match spec type for non space characters' do
    refute_view MiniTest::Spec.spec_type("Widget Helper\tTest")
    refute_view MiniTest::Spec.spec_type("Widget Helper\rTest")
    refute_view MiniTest::Spec.spec_type("Widget Helper\nTest")
    refute_view MiniTest::Spec.spec_type("Widget Helper\fTest")
    refute_view MiniTest::Spec.spec_type("Widget HelperXTest")
  end


  private

  def assert_view(actual)
    assert_equal ActionView::TestCase, actual
  end

  def refute_view(actual)
    refute_equal ActionView::TestCase, actual
  end

end

Version data entries

22 entries across 22 versions & 2 rubygems

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