Sha256: da8637aea0d2aa38025a68fb46e77c61f00484a1e4899cfa608693f86bd50853
Contents?: true
Size: 1.34 KB
Versions: 9
Compression:
Stored size: 1.34 KB
Contents
require 'test_helper' class NotificationMailer < ActionMailer::Base; end class Notifications < ActionMailer::Base; end class ActionMailerTest < MiniTestSpecRails::TestCase it 'matches spec type for class constants' do assert_mailer MiniTest::Spec.spec_type(NotificationMailer) assert_mailer MiniTest::Spec.spec_type(Notifications) end it 'matches spec type for strings' do assert_mailer MiniTest::Spec.spec_type('WidgetMailer') assert_mailer MiniTest::Spec.spec_type('WidgetMailerTest') assert_mailer MiniTest::Spec.spec_type('Widget Mailer Test') # And is case sensitive refute_mailer MiniTest::Spec.spec_type('widgetmailer') refute_mailer MiniTest::Spec.spec_type('widgetmailertest') refute_mailer MiniTest::Spec.spec_type('widget mailer test') end it 'wont match spec type for non space characters' do refute_mailer MiniTest::Spec.spec_type("Widget Mailer\tTest") refute_mailer MiniTest::Spec.spec_type("Widget Mailer\rTest") refute_mailer MiniTest::Spec.spec_type("Widget Mailer\nTest") refute_mailer MiniTest::Spec.spec_type("Widget Mailer\fTest") refute_mailer MiniTest::Spec.spec_type('Widget MailerXTest') end private def assert_mailer(actual) assert_equal ActionMailer::TestCase, actual end def refute_mailer(actual) refute_equal ActionMailer::TestCase, actual end end
Version data entries
9 entries across 9 versions & 1 rubygems