trestle_generator 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/templates/functional_test.rb +26 -0
- metadata +3 -3
data/README
CHANGED
@@ -46,7 +46,7 @@ solve the problem of GET vs POST more cleanly and comprehensively.
|
|
46
46
|
Why switch from scaffolds to trestles? USABILITY
|
47
47
|
--------------------------------------------------------------------------------
|
48
48
|
|
49
|
-
Trestle controllers have just
|
49
|
+
Trestle controllers have just five actions (list, new, show, edit, and destroy).
|
50
50
|
Contrast this with scaffold controllers which have eight actions to implement
|
51
51
|
the same functionality. This is mostly a matter of taste, but Rails developers
|
52
52
|
appreciate more than most that �less is more.�
|
@@ -41,6 +41,17 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase
|
|
41
41
|
assert_raise(ActiveRecord::RecordNotFound) { <%= model_name %>.find(1) }
|
42
42
|
end
|
43
43
|
|
44
|
+
def test_destroy<%= suffix %>_without_id
|
45
|
+
assert_not_nil <%= model_name %>.find(1)
|
46
|
+
|
47
|
+
post 'destroy<%= suffix %>'
|
48
|
+
assert_response :redirect
|
49
|
+
assert_redirected_to :action => 'list<%= suffix %>'
|
50
|
+
assert flash.has_key?(:notice)
|
51
|
+
|
52
|
+
assert_not_nil <%= model_name %>.find(1)
|
53
|
+
end
|
54
|
+
|
44
55
|
def test_edit<%= suffix %>_using_get
|
45
56
|
get 'edit<%= suffix %>', :id => 1
|
46
57
|
|
@@ -57,6 +68,13 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase
|
|
57
68
|
assert_redirected_to :action => 'show<%= suffix %>', :id => 1
|
58
69
|
end
|
59
70
|
|
71
|
+
def test_edit<%= suffix %>_without_id
|
72
|
+
post 'edit<%= suffix %>'
|
73
|
+
assert_response :redirect
|
74
|
+
assert_redirected_to :action => 'list<%= suffix %>'
|
75
|
+
assert flash.has_key?(:notice)
|
76
|
+
end
|
77
|
+
|
60
78
|
def test_list<%= suffix %>
|
61
79
|
get 'list<%= suffix %>'
|
62
80
|
|
@@ -95,4 +113,12 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase
|
|
95
113
|
assert_not_nil assigns(:<%= singular_name %>)
|
96
114
|
assert assigns(:<%= singular_name %>).valid?
|
97
115
|
end
|
116
|
+
|
117
|
+
def test_show<%= suffix %>_without_id
|
118
|
+
get 'show<%= suffix %>'
|
119
|
+
|
120
|
+
assert_response :redirect
|
121
|
+
assert_redirected_to :action => 'list<%= suffix %>'
|
122
|
+
assert flash.has_key?(:notice)
|
123
|
+
end
|
98
124
|
end
|
metadata
CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: trestle_generator
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.1.
|
7
|
-
date: 2006-05-
|
6
|
+
version: 1.1.5
|
7
|
+
date: 2006-05-18 00:00:00 -05:00
|
8
8
|
summary: "[Rails] A drop-in replacement for the scaffold generator that produces production-ready controllers that are safe from state-changing HTTP GET requests and that have streamlined URLs."
|
9
9
|
require_paths:
|
10
10
|
- templates
|
11
11
|
email: nils@alumni.rice.edu
|
12
12
|
homepage: http://trestle.rubyforge.org/
|
13
13
|
rubyforge_project: trestle
|
14
|
-
description: "
|
14
|
+
description: "Industrial-strength scaffolding for Ruby on Rails application development. Don\x92t drive your train across a gorge with nothing but a scaffold underneath it. Use a trestle instead! Learn more at http://trestle.rubyforge.org/."
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|