public
Description: Not scaffolding. Resourcing. Creates extremely customizable resource controllers with one line of code.
Clone URL: git://github.com/jnewland/resource_this.git
Search Repo:
OH HAI multi_rails!!
jnewland (author)
Mon Mar 03 12:08:50 -0800 2008
commit  0f80f8e919d74f95fa4e64759491b5654eed5ebe
tree    611da1703d0f035a932364fab8a2ca2ba9d240b5
parent  456fa6eaf9925653336b1608bd6132e0f7d2d52c
...
8
9
10
11
12
13
14
15
 
 
 
16
17
18
...
8
9
10
 
 
 
 
 
11
12
13
14
15
16
0
@@ -8,11 +8,9 @@ class ResourceThisNestingTest < Test::Unit::TestCase
0
     @response = ActionController::TestResponse.new
0
     @first = Post.create(:title => "test", :body => "test")
0
     @first_comment = Comment.create(:post => @first, :body => "test")
0
- with_routing do |set|
0
- set.draw do |map|
0
- map.resources :posts do |post|
0
- post.resources :comments
0
- end
0
+ ActionController::Routing::Routes.draw do |map|
0
+ map.resources :posts do |post|
0
+ post.resources :comments
0
       end
0
     end
0
   end
...
11
12
13
14
15
16
17
 
 
18
19
20
...
11
12
13
 
 
 
 
14
15
16
17
18
0
@@ -11,10 +11,8 @@ class ResourceThisSortingTest < Test::Unit::TestCase
0
     100.times do
0
       Widget.create(:title => "foo", :body => "bar")
0
     end
0
- with_routing do |set|
0
- set.draw do |map|
0
- map.resources :widgets
0
- end
0
+ ActionController::Routing::Routes.draw do |map|
0
+ map.resources :widgets
0
     end
0
   end
0
   
...
7
8
9
10
11
12
13
 
 
14
15
16
...
7
8
9
 
 
 
 
10
11
12
13
14
0
@@ -7,10 +7,8 @@ class ResourceThisTest < Test::Unit::TestCase
0
     @request.accept = 'application/xml'
0
     @response = ActionController::TestResponse.new
0
     @first = Post.create(:title => "test", :body => "test")
0
- with_routing do |set|
0
- set.draw do |map|
0
- map.resources :posts
0
- end
0
+ ActionController::Routing::Routes.draw do |map|
0
+ map.resources :posts
0
     end
0
   end
0
   
...
6
7
8
9
10
11
12
13
14
 
 
 
 
15
16
17
...
6
7
8
 
 
 
 
 
 
9
10
11
12
13
14
15
0
@@ -6,12 +6,10 @@ class ResourceThisUrlPrefixTest < Test::Unit::TestCase
0
     @request = ActionController::TestRequest.new
0
     @response = ActionController::TestResponse.new
0
     @first = Post.create(:title => "test", :body => "test")
0
- with_routing do |set|
0
- set.draw do |map|
0
- map.resources :posts
0
- map.with_options :path_prefix => 'admin', :name_prefix => 'admin_' do |map|
0
- map.resources :posts, :controller => 'admin/posts'
0
- end
0
+ ActionController::Routing::Routes.draw do |map|
0
+ map.resources :posts
0
+ map.with_options :path_prefix => 'admin', :name_prefix => 'admin_' do |map|
0
+ map.resources :posts, :controller => 'admin/posts'
0
       end
0
     end
0
   end
...
1
 
 
 
 
2
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
5
6
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
0
@@ -1,6 +1,23 @@
0
-require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
0
+$LOAD_PATH.unshift 'lib/'
0
+
0
+require 'rubygems'
0
+require 'multi_rails_init'
0
 require 'action_controller/test_process'
0
 require 'test/unit'
0
+require 'resource_this'
0
+
0
+begin
0
+ require 'redgreen'
0
+rescue LoadError
0
+ nil
0
+end
0
+
0
+RAILS_ROOT = '.' unless defined? RAILS_ROOT
0
+RAILS_ENV = 'test' unless defined? RAILS_ENV
0
+
0
+
0
+
0
+ActionController::Base.send :include, ResourceThis
0
 
0
 ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
0
 

Comments

    No one has commented yet.