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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -10
- data/CHANGELOG.rdoc +0 -24
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/Manifest.txt +31 -31
- data/README.rdoc +15 -17
- data/Rakefile +5 -6
- data/gemfiles/{4.0.gemfile → 4.1.gemfile} +2 -1
- data/lib/generators/minitest/controller/controller_generator.rb +20 -0
- data/lib/generators/{mini_test → minitest}/controller/templates/controller_spec.rb +0 -0
- data/lib/generators/{mini_test → minitest}/controller/templates/controller_test.rb +0 -0
- data/lib/generators/minitest/generator/generator_generator.rb +32 -0
- data/lib/generators/minitest/generator/templates/generator_spec.rb +14 -0
- data/lib/generators/minitest/generator/templates/generator_test.rb +15 -0
- data/lib/generators/minitest/helper/helper_generator.rb +19 -0
- data/lib/generators/{mini_test → minitest}/helper/templates/helper_spec.rb +0 -2
- data/lib/generators/{mini_test → minitest}/helper/templates/helper_test.rb +0 -0
- data/lib/generators/{mini_test → minitest}/install/install_generator.rb +2 -2
- data/lib/generators/{mini_test → minitest}/install/templates/test_helper.rb +0 -0
- data/lib/generators/minitest/integration/integration_generator.rb +19 -0
- data/lib/generators/{mini_test → minitest}/integration/templates/integration_spec.rb +0 -0
- data/lib/generators/{mini_test → minitest}/integration/templates/integration_test.rb +0 -0
- data/lib/generators/minitest/mailer/mailer_generator.rb +27 -0
- data/lib/generators/{mini_test → minitest}/mailer/templates/mailer_spec.rb +0 -0
- data/lib/generators/{mini_test → minitest}/mailer/templates/mailer_test.rb +0 -0
- data/lib/generators/minitest/mailer/templates/preview.rb +13 -0
- data/lib/generators/minitest/model/model_generator.rb +42 -0
- data/lib/generators/{mini_test → minitest}/model/templates/fixtures.yml +0 -0
- data/lib/generators/{mini_test → minitest}/model/templates/model_spec.rb +0 -0
- data/lib/generators/{mini_test → minitest}/model/templates/model_test.rb +0 -0
- data/lib/generators/{mini_test → minitest}/route/route_generator.rb +4 -4
- data/lib/generators/{mini_test → minitest}/route/templates/route_spec.rb +1 -1
- data/lib/generators/{mini_test → minitest}/route/templates/route_test.rb +1 -1
- data/lib/generators/minitest/scaffold/scaffold_generator.rb +38 -0
- data/lib/generators/{mini_test → minitest}/scaffold/templates/controller_spec.rb +4 -4
- data/lib/generators/{mini_test → minitest}/scaffold/templates/controller_test.rb +4 -4
- data/lib/generators/minitest.rb +14 -0
- data/lib/minitest/rails/assertions.rb +54 -270
- data/lib/minitest/rails/constant_lookup.rb +1 -1
- data/lib/minitest/rails/expectations.rb +2 -90
- data/lib/minitest/rails/railtie.rb +4 -4
- data/lib/minitest/rails/tasks/minitest.rake +20 -20
- data/lib/minitest/rails/tasks/sub_test_task.rb +1 -1
- data/lib/minitest/rails/testing.rb +2 -2
- data/lib/minitest/rails/version.rb +2 -2
- data/lib/minitest/rails.rb +38 -14
- data/minitest-rails.gemspec +13 -16
- data/tasks/test.rake +4 -31
- data/test/generators/test_controller_generator.rb +6 -6
- data/test/generators/test_generator_generator.rb +58 -0
- data/test/generators/test_helper_generator.rb +5 -5
- data/test/generators/test_install_generator.rb +3 -3
- data/test/generators/test_mailer_generator.rb +5 -5
- data/test/generators/test_model_generator.rb +9 -9
- data/test/generators/test_route_generator.rb +3 -3
- data/test/generators/test_scaffold_generator.rb +3 -3
- data/test/helper.rb +4 -1
- data/test/rails/action_controller/test_spec_type.rb +19 -14
- data/test/rails/action_dispatch/test_spec_type.rb +32 -29
- data/test/rails/action_mailer/test_spec_type.rb +19 -14
- data/test/rails/action_view/test_spec_type.rb +24 -18
- data/test/rails/active_support/test_assertions.rb +0 -28
- data/test/rails/active_support/test_expectations.rb +0 -28
- data/test/rails/active_support/test_spec_type.rb +9 -5
- data/test/rails/generators/test_spec_type.rb +13 -14
- data/test/test_sanity.rb +2 -2
- metadata +48 -61
- data/gemfiles/3.0.gemfile +0 -5
- data/gemfiles/3.1.gemfile +0 -5
- data/gemfiles/3.2.gemfile +0 -5
- data/gemfiles/minitest_tu_shim.rb +0 -4
- data/lib/generators/mini_test/controller/controller_generator.rb +0 -19
- data/lib/generators/mini_test/helper/helper_generator.rb +0 -17
- data/lib/generators/mini_test/integration/integration_generator.rb +0 -17
- data/lib/generators/mini_test/mailer/mailer_generator.rb +0 -19
- data/lib/generators/mini_test/model/model_generator.rb +0 -28
- data/lib/generators/mini_test/scaffold/scaffold_generator.rb +0 -42
- data/lib/generators/mini_test.rb +0 -42
- 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, <%=
|
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, <%=
|
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, <%=
|
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, <%=
|
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, <%=
|
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, <%=
|
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, <%=
|
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, <%=
|
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
|