shoulda_machinist_generator 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
3
|
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
4
|
-
|
4
|
+
|
5
5
|
context "The <%= controller_class_name %>Controller" do
|
6
|
-
|
6
|
+
|
7
7
|
setup do
|
8
8
|
@<%= file_name %> = <%= class_name %>.make
|
9
|
-
end
|
10
|
-
|
9
|
+
end
|
10
|
+
|
11
11
|
context 'GET to index' do
|
12
12
|
setup do
|
13
13
|
get :index
|
@@ -52,7 +52,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
|
52
52
|
end
|
53
53
|
|
54
54
|
context 'GET to show' do
|
55
|
-
setup do
|
55
|
+
setup do
|
56
56
|
get :show, :id => @<%= file_name %>.to_param
|
57
57
|
end
|
58
58
|
should_respond_with :success
|
@@ -80,7 +80,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
|
80
80
|
should_redirect_to("the show page") { <%= file_name %>_path(assigns(:<%= file_name %>))}
|
81
81
|
should_assign_to :<%= file_name %>
|
82
82
|
end
|
83
|
-
|
83
|
+
|
84
84
|
# context "with invalid parameters" do
|
85
85
|
# setup do
|
86
86
|
# assert_no_difference("<%= class_name %>.count") do
|
@@ -94,14 +94,15 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
|
94
94
|
# end
|
95
95
|
end
|
96
96
|
|
97
|
-
context 'DELETE to destroy' do
|
97
|
+
context 'DELETE to destroy' do
|
98
98
|
setup do
|
99
99
|
assert_difference('<%= class_name %>.count', -1) do
|
100
100
|
delete :destroy, :id => @<%= file_name %>.to_param
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
should_redirect_to
|
104
|
+
should_redirect_to ("the index page") { <%= table_name %>_path }
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
108
|
+
|