minitest-rails 2.2.1 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -6
- data/CHANGELOG.rdoc +0 -6
- data/Gemfile +1 -1
- data/Manifest.txt +6 -13
- data/Rakefile +4 -3
- data/gemfiles/5.0.gemfile +5 -0
- data/gemfiles/head.gemfile +5 -0
- data/lib/generators/minitest/controller/templates/controller_spec.rb +9 -5
- data/lib/generators/minitest/controller/templates/controller_test.rb +9 -5
- data/lib/generators/minitest/generator/generator_generator.rb +2 -3
- data/lib/generators/minitest/generator/templates/generator_spec.rb +1 -1
- data/lib/generators/minitest/generator/templates/generator_test.rb +1 -1
- data/lib/generators/minitest/helper/helper_generator.rb +1 -11
- data/lib/generators/minitest/integration/integration_generator.rb +1 -2
- data/lib/generators/minitest/integration/templates/integration_spec.rb +3 -3
- data/lib/generators/minitest/integration/templates/integration_test.rb +3 -3
- data/lib/generators/minitest/job/job_generator.rb +2 -3
- data/lib/generators/minitest/job/templates/job_spec.rb +3 -3
- data/lib/generators/minitest/job/templates/job_test.rb +3 -3
- data/lib/generators/minitest/mailer/mailer_generator.rb +9 -4
- data/lib/generators/minitest/mailer/templates/mailer_spec.rb +4 -4
- data/lib/generators/minitest/mailer/templates/mailer_test.rb +5 -5
- data/lib/generators/minitest/mailer/templates/preview.rb +5 -5
- data/lib/generators/minitest/model/model_generator.rb +3 -4
- data/lib/generators/minitest/model/templates/fixtures.yml +17 -12
- data/lib/generators/minitest/scaffold/scaffold_generator.rb +24 -3
- data/lib/generators/minitest/scaffold/templates/api_controller_spec.rb +42 -0
- data/lib/generators/minitest/scaffold/templates/api_controller_test.rb +44 -0
- data/lib/generators/minitest/scaffold/templates/controller_spec.rb +14 -11
- data/lib/generators/minitest/scaffold/templates/controller_test.rb +17 -14
- data/lib/minitest/rails.rb +10 -27
- data/lib/minitest/rails/assertions.rb +0 -561
- data/lib/minitest/rails/expectations.rb +0 -63
- data/lib/minitest/rails/version.rb +1 -1
- data/minitest-rails.gemspec +13 -10
- data/tasks/test.rake +8 -8
- data/test/generators/test_helper_generator.rb +8 -16
- data/test/generators/test_mailer_generator.rb +16 -17
- data/test/generators/test_model_generator.rb +1 -1
- data/test/generators/test_scaffold_generator.rb +2 -2
- data/test/helper.rb +16 -1
- data/test/rails/{action_controller → action_dispatch}/test_assertions.rb +4 -11
- data/test/rails/{action_controller → action_dispatch}/test_expectations.rb +4 -11
- data/test/rails/action_dispatch/test_spec_type.rb +6 -18
- data/test/rails/action_mailer/test_mailers.rb +6 -6
- data/test/rails/action_view/test_helpers.rb +2 -2
- metadata +28 -21
- data/gemfiles/4.1.gemfile +0 -5
- data/gemfiles/4.2.gemfile +0 -5
- data/lib/generators/minitest/helper/templates/helper_spec.rb +0 -9
- data/lib/generators/minitest/helper/templates/helper_test.rb +0 -9
- data/lib/generators/minitest/route/route_generator.rb +0 -28
- data/lib/generators/minitest/route/templates/route_spec.rb +0 -13
- data/lib/generators/minitest/route/templates/route_test.rb +0 -13
- data/test/generators/test_route_generator.rb +0 -24
- data/test/rails/action_controller/test_controllers.rb +0 -202
- data/test/rails/action_controller/test_spec_type.rb +0 -47
- data/test/rails/minitest_5_api_test.rb +0 -8
@@ -1,47 +0,0 @@
|
|
1
|
-
require "helper"
|
2
|
-
|
3
|
-
class ApplicationController < ActionController::Base; end
|
4
|
-
class ModelsController < ApplicationController; end
|
5
|
-
|
6
|
-
class TestApplicationControllerSpecType < Minitest::Test
|
7
|
-
def assert_controller actual
|
8
|
-
assert_equal ActionController::TestCase, actual
|
9
|
-
end
|
10
|
-
|
11
|
-
def refute_controller actual
|
12
|
-
refute_equal ActionController::TestCase, actual
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_spec_type_resolves_for_class_constants
|
16
|
-
assert_controller Minitest::Spec.spec_type(ApplicationController)
|
17
|
-
assert_controller Minitest::Spec.spec_type(ModelsController)
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_spec_type_resolves_for_matching_strings
|
21
|
-
assert_controller Minitest::Spec.spec_type("WidgetController")
|
22
|
-
assert_controller Minitest::Spec.spec_type("WidgetControllerTest")
|
23
|
-
assert_controller Minitest::Spec.spec_type("Widget Controller Test")
|
24
|
-
# And is not case sensitive
|
25
|
-
assert_controller Minitest::Spec.spec_type("widgetcontroller")
|
26
|
-
assert_controller Minitest::Spec.spec_type("widgetcontrollertest")
|
27
|
-
assert_controller Minitest::Spec.spec_type("widget controller test")
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_spec_type_wont_match_non_space_characters
|
31
|
-
refute_controller Minitest::Spec.spec_type("Widget Controller\tTest")
|
32
|
-
refute_controller Minitest::Spec.spec_type("Widget Controller\rTest")
|
33
|
-
refute_controller Minitest::Spec.spec_type("Widget Controller\nTest")
|
34
|
-
refute_controller Minitest::Spec.spec_type("Widget Controller\fTest")
|
35
|
-
refute_controller Minitest::Spec.spec_type("Widget ControllerXTest")
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_spec_type_doesnt_resolve_random_strings
|
39
|
-
refute_controller Minitest::Spec.spec_type("Unmatched String")
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_spec_type_resolves_for_additional_desc_controller
|
43
|
-
assert_controller Minitest::Spec.spec_type("Unmatched String", :controller)
|
44
|
-
assert_controller Minitest::Spec.spec_type("Unmatched String", :controller, :other)
|
45
|
-
assert_controller Minitest::Spec.spec_type("Unmatched String", :other, :controller)
|
46
|
-
end
|
47
|
-
end
|