minitest-spec-rails 6.2.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +8 -7
  3. data/Appraisals +5 -12
  4. data/CHANGELOG.md +7 -0
  5. data/README.md +11 -11
  6. data/gemfiles/rails_v6.0.x.gemfile.lock +107 -87
  7. data/gemfiles/{rails_v5.2.x.gemfile → rails_v6.1.x.gemfile} +1 -1
  8. data/gemfiles/rails_v6.1.x.gemfile.lock +175 -0
  9. data/gemfiles/rails_v7.0.x.gemfile +1 -2
  10. data/gemfiles/rails_v7.0.x.gemfile.lock +174 -0
  11. data/gemfiles/rails_v7.1.x.gemfile +9 -0
  12. data/lib/minitest-spec-rails/init/action_cable.rb +25 -0
  13. data/lib/minitest-spec-rails/init/action_view.rb +1 -3
  14. data/lib/minitest-spec-rails/railtie.rb +3 -0
  15. data/lib/minitest-spec-rails/version.rb +1 -1
  16. data/minitest-spec-rails.gemspec +2 -0
  17. data/test/cases/action_cable_test.rb +38 -0
  18. data/test/cases/active_support_test.rb +3 -3
  19. data/test/cases/mini_shoulda_test.rb +3 -3
  20. data/test/dummy_app/app/channels/application_cable/channel.rb +4 -0
  21. data/test/dummy_app/app/channels/application_cable/connection.rb +4 -0
  22. data/test/dummy_app/init.rb +5 -12
  23. data/test/dummy_app/tmp/development_secret.txt +1 -0
  24. data/test/dummy_tests/application_controller_test.rb +18 -18
  25. data/test/dummy_tests/foos_helper_test.rb +2 -2
  26. data/test/dummy_tests/integration_test.rb +3 -3
  27. data/test/dummy_tests/library_test.rb +3 -3
  28. data/test/dummy_tests/user_mailer_test.rb +20 -21
  29. data/test/dummy_tests/user_test.rb +15 -15
  30. data/test/dummy_tests/users_controller_test.rb +1 -1
  31. data/test/dummy_tests/users_helper_test.rb +15 -15
  32. data/test/support/shared_test_case_behavior.rb +0 -4
  33. metadata +47 -10
  34. data/gemfiles/rails_v5.1.x.gemfile +0 -8
  35. data/gemfiles/rails_v5.1.x.gemfile.lock +0 -130
  36. data/gemfiles/rails_v5.2.x.gemfile.lock +0 -136
@@ -0,0 +1,174 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ minitest-spec-rails (7.0.0)
5
+ minitest (>= 5.0)
6
+ railties (>= 4.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (7.0.4.3)
12
+ actionpack (= 7.0.4.3)
13
+ activesupport (= 7.0.4.3)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailbox (7.0.4.3)
17
+ actionpack (= 7.0.4.3)
18
+ activejob (= 7.0.4.3)
19
+ activerecord (= 7.0.4.3)
20
+ activestorage (= 7.0.4.3)
21
+ activesupport (= 7.0.4.3)
22
+ mail (>= 2.7.1)
23
+ net-imap
24
+ net-pop
25
+ net-smtp
26
+ actionmailer (7.0.4.3)
27
+ actionpack (= 7.0.4.3)
28
+ actionview (= 7.0.4.3)
29
+ activejob (= 7.0.4.3)
30
+ activesupport (= 7.0.4.3)
31
+ mail (~> 2.5, >= 2.5.4)
32
+ net-imap
33
+ net-pop
34
+ net-smtp
35
+ rails-dom-testing (~> 2.0)
36
+ actionpack (7.0.4.3)
37
+ actionview (= 7.0.4.3)
38
+ activesupport (= 7.0.4.3)
39
+ rack (~> 2.0, >= 2.2.0)
40
+ rack-test (>= 0.6.3)
41
+ rails-dom-testing (~> 2.0)
42
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
43
+ actiontext (7.0.4.3)
44
+ actionpack (= 7.0.4.3)
45
+ activerecord (= 7.0.4.3)
46
+ activestorage (= 7.0.4.3)
47
+ activesupport (= 7.0.4.3)
48
+ globalid (>= 0.6.0)
49
+ nokogiri (>= 1.8.5)
50
+ actionview (7.0.4.3)
51
+ activesupport (= 7.0.4.3)
52
+ builder (~> 3.1)
53
+ erubi (~> 1.4)
54
+ rails-dom-testing (~> 2.0)
55
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
56
+ activejob (7.0.4.3)
57
+ activesupport (= 7.0.4.3)
58
+ globalid (>= 0.3.6)
59
+ activemodel (7.0.4.3)
60
+ activesupport (= 7.0.4.3)
61
+ activerecord (7.0.4.3)
62
+ activemodel (= 7.0.4.3)
63
+ activesupport (= 7.0.4.3)
64
+ activestorage (7.0.4.3)
65
+ actionpack (= 7.0.4.3)
66
+ activejob (= 7.0.4.3)
67
+ activerecord (= 7.0.4.3)
68
+ activesupport (= 7.0.4.3)
69
+ marcel (~> 1.0)
70
+ mini_mime (>= 1.1.0)
71
+ activesupport (7.0.4.3)
72
+ concurrent-ruby (~> 1.0, >= 1.0.2)
73
+ i18n (>= 1.6, < 2)
74
+ minitest (>= 5.1)
75
+ tzinfo (~> 2.0)
76
+ appraisal (2.4.1)
77
+ bundler
78
+ rake
79
+ thor (>= 0.14.0)
80
+ builder (3.2.4)
81
+ coderay (1.1.3)
82
+ concurrent-ruby (1.2.2)
83
+ crass (1.0.6)
84
+ date (3.3.3)
85
+ erubi (1.12.0)
86
+ globalid (1.1.0)
87
+ activesupport (>= 5.0)
88
+ i18n (1.13.0)
89
+ concurrent-ruby (~> 1.0)
90
+ loofah (2.21.3)
91
+ crass (~> 1.0.2)
92
+ nokogiri (>= 1.12.0)
93
+ mail (2.8.1)
94
+ mini_mime (>= 0.1.1)
95
+ net-imap
96
+ net-pop
97
+ net-smtp
98
+ marcel (1.0.2)
99
+ method_source (1.0.0)
100
+ mini_mime (1.1.2)
101
+ minitest (5.18.0)
102
+ minitest-focus (1.3.1)
103
+ minitest (>= 4, < 6)
104
+ net-imap (0.3.4)
105
+ date
106
+ net-protocol
107
+ net-pop (0.1.2)
108
+ net-protocol
109
+ net-protocol (0.2.1)
110
+ timeout
111
+ net-smtp (0.3.3)
112
+ net-protocol
113
+ nio4r (2.5.9)
114
+ nokogiri (1.15.1-arm64-darwin)
115
+ racc (~> 1.4)
116
+ pry (0.14.2)
117
+ coderay (~> 1.1)
118
+ method_source (~> 1.0)
119
+ racc (1.6.2)
120
+ rack (2.2.7)
121
+ rack-test (2.1.0)
122
+ rack (>= 1.3)
123
+ rails (7.0.4.3)
124
+ actioncable (= 7.0.4.3)
125
+ actionmailbox (= 7.0.4.3)
126
+ actionmailer (= 7.0.4.3)
127
+ actionpack (= 7.0.4.3)
128
+ actiontext (= 7.0.4.3)
129
+ actionview (= 7.0.4.3)
130
+ activejob (= 7.0.4.3)
131
+ activemodel (= 7.0.4.3)
132
+ activerecord (= 7.0.4.3)
133
+ activestorage (= 7.0.4.3)
134
+ activesupport (= 7.0.4.3)
135
+ bundler (>= 1.15.0)
136
+ railties (= 7.0.4.3)
137
+ rails-dom-testing (2.0.3)
138
+ activesupport (>= 4.2.0)
139
+ nokogiri (>= 1.6)
140
+ rails-html-sanitizer (1.5.0)
141
+ loofah (~> 2.19, >= 2.19.1)
142
+ railties (7.0.4.3)
143
+ actionpack (= 7.0.4.3)
144
+ activesupport (= 7.0.4.3)
145
+ method_source
146
+ rake (>= 12.2)
147
+ thor (~> 1.0)
148
+ zeitwerk (~> 2.5)
149
+ rake (13.0.6)
150
+ sqlite3 (1.6.3-arm64-darwin)
151
+ thor (1.2.2)
152
+ timeout (0.3.2)
153
+ tzinfo (2.0.6)
154
+ concurrent-ruby (~> 1.0)
155
+ websocket-driver (0.7.5)
156
+ websocket-extensions (>= 0.1.0)
157
+ websocket-extensions (0.1.5)
158
+ zeitwerk (2.6.8)
159
+
160
+ PLATFORMS
161
+ arm64-darwin-22
162
+
163
+ DEPENDENCIES
164
+ appraisal
165
+ minitest
166
+ minitest-focus
167
+ minitest-spec-rails!
168
+ pry
169
+ rails (~> 7.0.0)
170
+ rake
171
+ sqlite3
172
+
173
+ BUNDLED WITH
174
+ 2.4.12
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 7.1.0"
6
+ gem "minitest"
7
+ gem "view_component", require: "view_component/engine"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,25 @@
1
+ require 'action_cable/channel'
2
+ require 'action_cable/channel/test_case'
3
+
4
+ module MiniTestSpecRails
5
+ module Init
6
+ module ActionCableBehavior
7
+ extend ActiveSupport::Concern
8
+
9
+ included do
10
+ class_attribute :_helper_class
11
+ register_spec_type(/(Channel)( ?Test)?\z/, self)
12
+ register_spec_type(self) { |desc| desc.is_a?(Class) && desc < self }
13
+ extend Descriptions
14
+ end
15
+
16
+ module Descriptions
17
+ def described_class
18
+ determine_default_helper_class(name)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ ActionCable::Channel::TestCase.include MiniTestSpecRails::Init::ActionCableBehavior
@@ -19,6 +19,4 @@ module MiniTestSpecRails
19
19
  end
20
20
  end
21
21
 
22
- Rails.application.reloader.to_prepare do
23
- ActionView::TestCase.send :include, MiniTestSpecRails::Init::ActionViewBehavior
24
- end
22
+ ActionView::TestCase.send :include, MiniTestSpecRails::Init::ActionViewBehavior
@@ -7,6 +7,9 @@ module MiniTestSpecRails
7
7
  require 'active_support'
8
8
  require 'minitest-spec-rails/init/active_support'
9
9
  require 'minitest-spec-rails/parallelize'
10
+ ActiveSupport.on_load(:action_cable) do
11
+ require 'minitest-spec-rails/init/action_cable'
12
+ end
10
13
  ActiveSupport.on_load(:action_controller) do
11
14
  require 'minitest-spec-rails/init/action_controller'
12
15
  require 'minitest-spec-rails/init/action_dispatch'
@@ -1,3 +1,3 @@
1
1
  module MiniTestSpecRails
2
- VERSION = '6.2.0'.freeze
2
+ VERSION = '7.0.0'.freeze
3
3
  end
@@ -19,6 +19,8 @@ Gem::Specification.new do |gem|
19
19
  gem.add_runtime_dependency 'minitest', '>= 5.0'
20
20
  gem.add_runtime_dependency 'railties', '>= 4.1'
21
21
  gem.add_development_dependency 'appraisal'
22
+ gem.add_development_dependency 'minitest-focus'
23
+ gem.add_development_dependency 'pry'
22
24
  gem.add_development_dependency 'rake'
23
25
  gem.add_development_dependency 'sqlite3'
24
26
  end
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ class ModelsChannel < ApplicationCable::Channel; end
4
+
5
+ class ActionCableChannelTest < MiniTestSpecRails::TestCase
6
+ it 'matches spec type for class constants' do
7
+ assert_channel_test MiniTest::Spec.spec_type(ApplicationCable::Channel)
8
+ assert_channel_test MiniTest::Spec.spec_type(ModelsChannel)
9
+ end
10
+
11
+ it 'matches spec type for strings' do
12
+ assert_channel_test MiniTest::Spec.spec_type('WidgetChannel')
13
+ assert_channel_test MiniTest::Spec.spec_type('WidgetChannelTest')
14
+ assert_channel_test MiniTest::Spec.spec_type('Widget Channel Test')
15
+ # And is case sensitive
16
+ refute_channel_test MiniTest::Spec.spec_type('widgetcontroller')
17
+ refute_channel_test MiniTest::Spec.spec_type('widgetcontrollertest')
18
+ refute_channel_test MiniTest::Spec.spec_type('widget controller test')
19
+ end
20
+
21
+ it 'wont match spec type for non space characters' do
22
+ refute_channel_test MiniTest::Spec.spec_type("Widget Channel\tTest")
23
+ refute_channel_test MiniTest::Spec.spec_type("Widget Channel\rTest")
24
+ refute_channel_test MiniTest::Spec.spec_type("Widget Channel\nTest")
25
+ refute_channel_test MiniTest::Spec.spec_type("Widget Channel\fTest")
26
+ refute_channel_test MiniTest::Spec.spec_type('Widget ChannelXTest')
27
+ end
28
+
29
+ private
30
+
31
+ def assert_channel_test(actual)
32
+ assert_equal ActionCable::Channel::TestCase, actual
33
+ end
34
+
35
+ def refute_channel_test(actual)
36
+ refute_equal ActionCable::Channel::TestCase, actual
37
+ end
38
+ end
@@ -28,8 +28,8 @@ class ActiveSupportCallbackTest < ActiveSupport::TestCase
28
28
  setup :bar
29
29
 
30
30
  it 'works' do
31
- @foo.must_equal 'foo'
32
- @bar.must_equal 'bar'
31
+ expect(@foo).must_equal 'foo'
32
+ expect(@bar).must_equal 'bar'
33
33
  end
34
34
 
35
35
  private
@@ -45,7 +45,7 @@ end
45
45
 
46
46
  class ActiveSupportSpecTest < ActiveSupport::TestCase
47
47
  it 'current spec name' do
48
- Thread.current[:current_spec].must_equal self
48
+ expect(Thread.current[:current_spec]).must_equal self
49
49
  end
50
50
  end
51
51
 
@@ -14,11 +14,11 @@ class PostTests < ActiveSupport::TestCase
14
14
  end
15
15
 
16
16
  should 'setup correctly' do
17
- @post.must_be_instance_of Post
17
+ expect(@post).must_be_instance_of Post
18
18
  end
19
19
 
20
20
  should 'teardown correctly' do
21
- $teardown_ran.must_equal true
21
+ expect($teardown_ran).must_equal true
22
22
  end
23
23
 
24
24
  should_eventually 'will be skipped' do
@@ -27,7 +27,7 @@ class PostTests < ActiveSupport::TestCase
27
27
 
28
28
  context 'level 1' do
29
29
  should 'work' do
30
- @post.must_be_instance_of Post
30
+ expect(@post).must_be_instance_of Post
31
31
  end
32
32
  end
33
33
  end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -3,25 +3,19 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
3
3
  require 'bundler/setup'
4
4
  require 'rails/all'
5
5
  Bundler.require(:default, Rails.env)
6
+ require 'minitest/focus'
7
+ require 'pry'
6
8
 
7
9
  module Dummy
8
10
  class Application < ::Rails::Application
9
11
  # Basic Engine
10
12
  config.root = File.join __FILE__, '..'
11
13
  config.cache_store = :memory_store
12
- config.assets.enabled = false
13
- if Rails.version > '5.0'
14
- config.secret_key_base = '012345678901234567890123456789'
15
- else
16
- config.secret_token = '012345678901234567890123456789'
17
- end
14
+ config.assets.enabled = false if Rails.version < '7.0.0'
15
+ config.secret_token = '012345678901234567890123456789'
18
16
  config.active_support.test_order = :random
19
- if config.active_record.sqlite3.respond_to?(:represent_boolean_as_integer)
20
- config.active_record.sqlite3.represent_boolean_as_integer = true
21
- end
22
-
23
17
  # Mimic Test Environment Config.
24
- config.whiny_nils = true if Rails.version < '4.0'
18
+ config.whiny_nils = true
25
19
  config.consider_all_requests_local = true
26
20
  config.action_controller.perform_caching = false
27
21
  config.action_dispatch.show_exceptions = false
@@ -33,7 +27,6 @@ module Dummy
33
27
  config.dependency_loading = true
34
28
  config.preload_frameworks = true
35
29
  config.eager_load = true
36
-
37
30
  # Custom
38
31
  config.minitest_spec_rails.mini_shoulda = true
39
32
  end
@@ -0,0 +1 @@
1
+ f45200b1a337dea2b5a19a5ff07a057008eabe34dd706a01bd3c7f8b744e2d094f3fa3cd681d7d8aeb0a317d65cc26749c11acdada6684dc092e6bdc928c0884
@@ -7,7 +7,7 @@ module ApplicationControllerTests
7
7
 
8
8
  it 'works' do
9
9
  get :index
10
- response.body.must_equal '<h1>Rendered MiniTest::Spec</h1>'
10
+ expect(response.body).must_equal '<h1>Rendered MiniTest::Spec</h1>'
11
11
  end
12
12
 
13
13
  it 'allows custom assertions' do
@@ -15,18 +15,18 @@ module ApplicationControllerTests
15
15
  end
16
16
 
17
17
  it 'can find the controller_class' do
18
- self.class.controller_class.must_equal ApplicationController
18
+ expect(self.class.controller_class).must_equal ApplicationController
19
19
  end
20
20
 
21
21
  it 'can access the setup ivars' do
22
- @controller.must_be_kind_of ApplicationController
22
+ expect(@controller).must_be_kind_of ApplicationController
23
23
  end
24
24
 
25
25
  describe 'nested 1' do
26
26
  it('works') { skip }
27
27
 
28
28
  it 'can find the controller_class' do
29
- self.class.controller_class.must_equal ApplicationController
29
+ expect(self.class.controller_class).must_equal ApplicationController
30
30
  end
31
31
 
32
32
  describe 'nested 2' do
@@ -39,18 +39,18 @@ end
39
39
  class ApplicationControllerTest < ActionController::TestCase
40
40
  include ApplicationControllerTests
41
41
  it 'reflects' do
42
- described_class.must_equal ApplicationController
43
- self.class.described_class.must_equal ApplicationController
42
+ expect(described_class).must_equal ApplicationController
43
+ expect(self.class.described_class).must_equal ApplicationController
44
44
  end
45
45
  describe 'level 1' do
46
46
  it 'reflects' do
47
- described_class.must_equal ApplicationController
48
- self.class.described_class.must_equal ApplicationController
47
+ expect(described_class).must_equal ApplicationController
48
+ expect(self.class.described_class).must_equal ApplicationController
49
49
  end
50
50
  describe 'level 2' do
51
51
  it 'reflects' do
52
- described_class.must_equal ApplicationController
53
- self.class.described_class.must_equal ApplicationController
52
+ expect(described_class).must_equal ApplicationController
53
+ expect(self.class.described_class).must_equal ApplicationController
54
54
  end
55
55
  end
56
56
  end
@@ -59,22 +59,22 @@ end
59
59
  describe ApplicationController do
60
60
  include ApplicationControllerTests
61
61
  it 'class reflects' do
62
- described_class.must_equal ApplicationController
63
- self.class.described_class.must_equal ApplicationController
62
+ expect(described_class).must_equal ApplicationController
63
+ expect(self.class.described_class).must_equal ApplicationController
64
64
  end
65
65
  it 'reflects' do
66
- described_class.must_equal ApplicationController
67
- self.class.described_class.must_equal ApplicationController
66
+ expect(described_class).must_equal ApplicationController
67
+ expect(self.class.described_class).must_equal ApplicationController
68
68
  end
69
69
  describe 'level 1' do
70
70
  it 'reflects' do
71
- described_class.must_equal ApplicationController
72
- self.class.described_class.must_equal ApplicationController
71
+ expect(described_class).must_equal ApplicationController
72
+ expect(self.class.described_class).must_equal ApplicationController
73
73
  end
74
74
  describe 'level 2' do
75
75
  it 'reflects' do
76
- described_class.must_equal ApplicationController
77
- self.class.described_class.must_equal ApplicationController
76
+ expect(described_class).must_equal ApplicationController
77
+ expect(self.class.described_class).must_equal ApplicationController
78
78
  end
79
79
  end
80
80
  end
@@ -2,8 +2,8 @@ require 'test_helper_dummy'
2
2
 
3
3
  class FoosHelperTest < ActionView::TestCase
4
4
  it 'allows path and url helpers' do
5
- users_path_helper.must_equal '/users'
6
- users_url_helper.must_equal 'http://test.host/users'
5
+ expect(users_path_helper).must_equal '/users'
6
+ expect(users_url_helper).must_equal 'http://test.host/users'
7
7
  end
8
8
 
9
9
  describe 'level1' do
@@ -7,7 +7,7 @@ module IntegrationTests
7
7
 
8
8
  it 'works' do
9
9
  get root_path
10
- status.must_equal 200
10
+ expect(status).must_equal 200
11
11
  end
12
12
 
13
13
  it 'works with assert_routing' do
@@ -15,14 +15,14 @@ module IntegrationTests
15
15
  end
16
16
 
17
17
  it 'can find the app' do
18
- app.must_be_instance_of Dummy::Application
18
+ expect(app).must_be_instance_of Dummy::Application
19
19
  end
20
20
 
21
21
  describe 'nested 1' do
22
22
  it('works') { skip }
23
23
 
24
24
  it 'can find the app' do
25
- app.must_be_instance_of Dummy::Application
25
+ expect(app).must_be_instance_of Dummy::Application
26
26
  end
27
27
 
28
28
  describe 'nested 2' do
@@ -3,13 +3,13 @@ require "#{Dummy::Application.root}/lib/library"
3
3
 
4
4
  class LibraryTest < ActiveSupport::TestCase
5
5
  it 'reflects' do
6
- described_class.must_equal Library
6
+ expect(described_class).must_equal Library
7
7
  end
8
8
  end
9
9
 
10
10
  describe Library do
11
11
  it 'reflects' do
12
- described_class.must_equal Library
13
- self.class.described_class.must_equal Library
12
+ expect(described_class).must_equal Library
13
+ expect(self.class.described_class).must_equal Library
14
14
  end
15
15
  end
@@ -7,18 +7,17 @@ module UserMailerTests
7
7
  let(:user_mailer_class) { UserMailer }
8
8
  let(:user_email) do
9
9
  user_mailer_class.welcome(user_ken).tap do |mail|
10
- laterable = Rails.version > '4.2' || Rails.version.starts_with?('4.2')
11
- laterable ? mail.deliver_now : mail.deliver
10
+ mail.deliver_now
12
11
  end
13
12
  end
14
13
 
15
14
  it 'works' do
16
- deliveries.must_be :empty?
15
+ expect(deliveries).must_be :empty?
17
16
  user_email
18
- deliveries.wont_be :empty?
19
- user_email.to.must_equal [user_ken.email]
20
- user_email.from.must_equal ['rails@minitest.spec']
21
- user_email.body.encoded.must_equal "Welcome to MiniTest::Spec #{user_ken.email}!"
17
+ expect(deliveries).wont_be :empty?
18
+ expect(user_email.to).must_equal [user_ken.email]
19
+ expect(user_email.from).must_equal ['rails@minitest.spec']
20
+ expect(user_email.body.encoded).must_equal "Welcome to MiniTest::Spec #{user_ken.email}!"
22
21
  end
23
22
 
24
23
  it 'allows custom assertions' do
@@ -26,14 +25,14 @@ module UserMailerTests
26
25
  end
27
26
 
28
27
  it 'can find the mailer_class' do
29
- self.class.mailer_class.must_equal user_mailer_class
28
+ expect(self.class.mailer_class).must_equal user_mailer_class
30
29
  end
31
30
 
32
31
  describe 'nested 1' do
33
32
  it('works') { skip }
34
33
 
35
34
  it 'can find the mailer_class' do
36
- self.class.mailer_class.must_equal user_mailer_class
35
+ expect(self.class.mailer_class).must_equal user_mailer_class
37
36
  end
38
37
 
39
38
  describe 'nested 2' do
@@ -46,18 +45,18 @@ end
46
45
  class UserMailerTest < ActionMailer::TestCase
47
46
  include UserMailerTests
48
47
  it 'reflects' do
49
- described_class.must_equal UserMailer
50
- self.class.described_class.must_equal UserMailer
48
+ expect(described_class).must_equal UserMailer
49
+ expect(self.class.described_class).must_equal UserMailer
51
50
  end
52
51
  describe 'level 1' do
53
52
  it 'reflects' do
54
- described_class.must_equal UserMailer
55
- self.class.described_class.must_equal UserMailer
53
+ expect(described_class).must_equal UserMailer
54
+ expect(self.class.described_class).must_equal UserMailer
56
55
  end
57
56
  describe 'level 2' do
58
57
  it 'reflects' do
59
- described_class.must_equal UserMailer
60
- self.class.described_class.must_equal UserMailer
58
+ expect(described_class).must_equal UserMailer
59
+ expect(self.class.described_class).must_equal UserMailer
61
60
  end
62
61
  end
63
62
  end
@@ -66,18 +65,18 @@ end
66
65
  describe UserMailer do
67
66
  include UserMailerTests
68
67
  it 'reflects' do
69
- described_class.must_equal UserMailer
70
- self.class.described_class.must_equal UserMailer
68
+ expect(described_class).must_equal UserMailer
69
+ expect(self.class.described_class).must_equal UserMailer
71
70
  end
72
71
  describe 'level 1' do
73
72
  it 'reflects' do
74
- described_class.must_equal UserMailer
75
- self.class.described_class.must_equal UserMailer
73
+ expect(described_class).must_equal UserMailer
74
+ expect(self.class.described_class).must_equal UserMailer
76
75
  end
77
76
  describe 'level 2' do
78
77
  it 'reflects' do
79
- described_class.must_equal UserMailer
80
- self.class.described_class.must_equal UserMailer
78
+ expect(described_class).must_equal UserMailer
79
+ expect(self.class.described_class).must_equal UserMailer
81
80
  end
82
81
  end
83
82
  end