minitest-rails 1.0.1 → 2.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -10
  3. data/CHANGELOG.rdoc +0 -24
  4. data/Gemfile +1 -1
  5. data/LICENSE +1 -1
  6. data/Manifest.txt +31 -31
  7. data/README.rdoc +15 -17
  8. data/Rakefile +5 -6
  9. data/gemfiles/{4.0.gemfile → 4.1.gemfile} +2 -1
  10. data/lib/generators/minitest/controller/controller_generator.rb +20 -0
  11. data/lib/generators/{mini_test → minitest}/controller/templates/controller_spec.rb +0 -0
  12. data/lib/generators/{mini_test → minitest}/controller/templates/controller_test.rb +0 -0
  13. data/lib/generators/minitest/generator/generator_generator.rb +32 -0
  14. data/lib/generators/minitest/generator/templates/generator_spec.rb +14 -0
  15. data/lib/generators/minitest/generator/templates/generator_test.rb +15 -0
  16. data/lib/generators/minitest/helper/helper_generator.rb +19 -0
  17. data/lib/generators/{mini_test → minitest}/helper/templates/helper_spec.rb +0 -2
  18. data/lib/generators/{mini_test → minitest}/helper/templates/helper_test.rb +0 -0
  19. data/lib/generators/{mini_test → minitest}/install/install_generator.rb +2 -2
  20. data/lib/generators/{mini_test → minitest}/install/templates/test_helper.rb +0 -0
  21. data/lib/generators/minitest/integration/integration_generator.rb +19 -0
  22. data/lib/generators/{mini_test → minitest}/integration/templates/integration_spec.rb +0 -0
  23. data/lib/generators/{mini_test → minitest}/integration/templates/integration_test.rb +0 -0
  24. data/lib/generators/minitest/mailer/mailer_generator.rb +27 -0
  25. data/lib/generators/{mini_test → minitest}/mailer/templates/mailer_spec.rb +0 -0
  26. data/lib/generators/{mini_test → minitest}/mailer/templates/mailer_test.rb +0 -0
  27. data/lib/generators/minitest/mailer/templates/preview.rb +13 -0
  28. data/lib/generators/minitest/model/model_generator.rb +42 -0
  29. data/lib/generators/{mini_test → minitest}/model/templates/fixtures.yml +0 -0
  30. data/lib/generators/{mini_test → minitest}/model/templates/model_spec.rb +0 -0
  31. data/lib/generators/{mini_test → minitest}/model/templates/model_test.rb +0 -0
  32. data/lib/generators/{mini_test → minitest}/route/route_generator.rb +4 -4
  33. data/lib/generators/{mini_test → minitest}/route/templates/route_spec.rb +1 -1
  34. data/lib/generators/{mini_test → minitest}/route/templates/route_test.rb +1 -1
  35. data/lib/generators/minitest/scaffold/scaffold_generator.rb +38 -0
  36. data/lib/generators/{mini_test → minitest}/scaffold/templates/controller_spec.rb +4 -4
  37. data/lib/generators/{mini_test → minitest}/scaffold/templates/controller_test.rb +4 -4
  38. data/lib/generators/minitest.rb +14 -0
  39. data/lib/minitest/rails/assertions.rb +54 -270
  40. data/lib/minitest/rails/constant_lookup.rb +1 -1
  41. data/lib/minitest/rails/expectations.rb +2 -90
  42. data/lib/minitest/rails/railtie.rb +4 -4
  43. data/lib/minitest/rails/tasks/minitest.rake +20 -20
  44. data/lib/minitest/rails/tasks/sub_test_task.rb +1 -1
  45. data/lib/minitest/rails/testing.rb +2 -2
  46. data/lib/minitest/rails/version.rb +2 -2
  47. data/lib/minitest/rails.rb +38 -14
  48. data/minitest-rails.gemspec +13 -16
  49. data/tasks/test.rake +4 -31
  50. data/test/generators/test_controller_generator.rb +6 -6
  51. data/test/generators/test_generator_generator.rb +58 -0
  52. data/test/generators/test_helper_generator.rb +5 -5
  53. data/test/generators/test_install_generator.rb +3 -3
  54. data/test/generators/test_mailer_generator.rb +5 -5
  55. data/test/generators/test_model_generator.rb +9 -9
  56. data/test/generators/test_route_generator.rb +3 -3
  57. data/test/generators/test_scaffold_generator.rb +3 -3
  58. data/test/helper.rb +4 -1
  59. data/test/rails/action_controller/test_spec_type.rb +19 -14
  60. data/test/rails/action_dispatch/test_spec_type.rb +32 -29
  61. data/test/rails/action_mailer/test_spec_type.rb +19 -14
  62. data/test/rails/action_view/test_spec_type.rb +24 -18
  63. data/test/rails/active_support/test_assertions.rb +0 -28
  64. data/test/rails/active_support/test_expectations.rb +0 -28
  65. data/test/rails/active_support/test_spec_type.rb +9 -5
  66. data/test/rails/generators/test_spec_type.rb +13 -14
  67. data/test/test_sanity.rb +2 -2
  68. metadata +48 -61
  69. data/gemfiles/3.0.gemfile +0 -5
  70. data/gemfiles/3.1.gemfile +0 -5
  71. data/gemfiles/3.2.gemfile +0 -5
  72. data/gemfiles/minitest_tu_shim.rb +0 -4
  73. data/lib/generators/mini_test/controller/controller_generator.rb +0 -19
  74. data/lib/generators/mini_test/helper/helper_generator.rb +0 -17
  75. data/lib/generators/mini_test/integration/integration_generator.rb +0 -17
  76. data/lib/generators/mini_test/mailer/mailer_generator.rb +0 -19
  77. data/lib/generators/mini_test/model/model_generator.rb +0 -28
  78. data/lib/generators/mini_test/scaffold/scaffold_generator.rb +0 -42
  79. data/lib/generators/mini_test.rb +0 -42
  80. data/lib/minitest/rails/generators.rb +0 -18
@@ -25,23 +25,23 @@ describe <%= controller_class_name %>Controller do
25
25
  end
26
26
 
27
27
  it "shows <%= singular_table_name %>" do
28
- get :show, <%= key_value :id, "#{singular_table_name}" %>
28
+ get :show, id: <%= singular_table_name %>
29
29
  assert_response :success
30
30
  end
31
31
 
32
32
  it "gets edit" do
33
- get :edit, <%= key_value :id, "#{singular_table_name}" %>
33
+ get :edit, id: <%= singular_table_name %>
34
34
  assert_response :success
35
35
  end
36
36
 
37
37
  it "updates <%= singular_table_name %>" do
38
- put :update, <%= key_value :id, "#{singular_table_name}" %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
38
+ put :update, id: <%= singular_table_name %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
39
39
  assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>))
40
40
  end
41
41
 
42
42
  it "destroys <%= singular_table_name %>" do
43
43
  assert_difference('<%= class_name %>.count', -1) do
44
- delete :destroy, <%= key_value :id, "#{singular_table_name}" %>
44
+ delete :destroy, id: <%= singular_table_name %>
45
45
  end
46
46
 
47
47
  assert_redirected_to <%= index_helper %>_path
@@ -27,23 +27,23 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
27
27
  end
28
28
 
29
29
  def test_show
30
- get :show, <%= key_value :id, singular_table_name %>
30
+ get :show, id: <%= singular_table_name %>
31
31
  assert_response :success
32
32
  end
33
33
 
34
34
  def test_edit
35
- get :edit, <%= key_value :id, singular_table_name %>
35
+ get :edit, id: <%= singular_table_name %>
36
36
  assert_response :success
37
37
  end
38
38
 
39
39
  def test_update
40
- put :update, <%= key_value :id, singular_table_name %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
40
+ put :update, id: <%= singular_table_name %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %>
41
41
  assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>))
42
42
  end
43
43
 
44
44
  def test_destroy
45
45
  assert_difference('<%= class_name %>.count', -1) do
46
- delete :destroy, <%= key_value :id, singular_table_name %>
46
+ delete :destroy, id: <%= singular_table_name %>
47
47
  end
48
48
 
49
49
  assert_redirected_to <%= index_helper %>_path
@@ -0,0 +1,14 @@
1
+ require 'rails/generators/named_base'
2
+
3
+ module Minitest
4
+ module Generators
5
+ class Base < ::Rails::Generators::NamedBase #:nodoc:
6
+ class_option :spec, type: :boolean, default: false,
7
+ desc: "Use Minitest::Spec DSL"
8
+
9
+ def self.default_source_root
10
+ File.expand_path(File.join(File.dirname(__FILE__), 'minitest', generator_name, 'templates'))
11
+ end
12
+ end
13
+ end
14
+ end