public
Rubygem
Fork of ryanb/nifty-generators
Description: A collection of useful Rails generator scripts by Ryan Bates.
Clone URL: git://github.com/ooodigi/nifty-generators.git
Search Repo:
mentioning tests in readme/usage and fixing a broken test
ryanb (author)
Fri May 09 10:29:28 -0700 2008
commit  3a23384c9adbe9a83a391ab10fb9be433b4d25a4
tree    4c447507be52d815802a7983a7cba3079c41e886
parent  4144ae0a8e55e8d03ccc78ca91302e1dbe998450
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+* adding tests and specs to scaffold generator
0
+
0
 *0.1.0* (May 8th, 2008)
0
 
0
 * initial release
0
...
44
45
46
 
 
 
 
 
 
 
 
 
 
 
 
 
47
48
49
...
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
0
@@ -44,6 +44,19 @@ Try restarting your development server. Sometimes it doesn't detect the
0
 change in the routing.
0
 
0
 
0
+*The tests/specs don't work for nifty_scaffold.*
0
+
0
+Make sure you have mocha installed and require it in your spec/test helper.
0
+
0
+ gem install mocha
0
+
0
+ # in spec_helper.rb
0
+ config.mock_with :mocha
0
+
0
+ # in test_helper.rb
0
+ require 'mocha'
0
+
0
+
0
 == Development
0
 
0
 This project can be found on github at the following URL.
0
...
1
2
3
4
...
1
2
 
3
0
@@ -1,4 +1,3 @@
0
 
0
 Nifty Scaffold Generator
0
- - generate tests/specs
0
   - add some validation for attributes/action names
...
1
2
3
4
5
 
 
6
7
8
...
1
2
3
 
 
4
5
6
7
8
0
@@ -1,8 +1,8 @@
0
 Description:
0
     Scaffolds an entire resource, from model and migration to controller and
0
     views. The resource is ready to use as a starting point for your restful,
0
- resource-oriented application. Tests are not generated yet, but expect
0
- them in future releases.
0
+ resource-oriented application. Tests or specs are also generated depending
0
+ on if you have a "spec" directory or not.
0
 
0
 Usage:
0
     Pass the name of the model, either CamelCased or under_scored, as the first
...
461
462
463
464
 
465
466
467
...
471
472
473
474
 
475
476
477
...
461
462
463
 
464
465
466
467
...
471
472
473
 
474
475
476
477
0
@@ -461,7 +461,7 @@ class TestNiftyScaffoldGenerator < Test::Unit::TestCase
0
         
0
         should "should redirect to index action on successful create" do
0
           assert_generated_file "test/functional/line_items_controller_test.rb" do |body|
0
- assert_match "redirect_to(line_items_path)", body
0
+ assert_match "assert_redirected_to line_items_path", body
0
           end
0
         end
0
       end
0
@@ -471,7 +471,7 @@ class TestNiftyScaffoldGenerator < Test::Unit::TestCase
0
         
0
         should "should redirect to index action on successful update" do
0
           assert_generated_file "test/functional/line_items_controller_test.rb" do |body|
0
- assert_match "redirect_to(line_items_path)", body
0
+ assert_match "assert_redirected_to line_items_path", body
0
           end
0
         end
0
       end

Comments

    No one has commented yet.