public
Rubygem
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
- fixed the rails root to rails 2.0.2
- updated the rails root to rails 2 standards
- added .autotest file to fix autotest
- fixed bug in determining the resource path



git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@286 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
tsaleh (author)
Mon Jan 21 06:13:43 -0800 2008
commit  46f8ff243700e15bc6c4b1b08a4494ba7c9559c9
tree    1de81f1d1e32e6dff9b151dd5cf1e445f985afb4
parent  91a3bb5e6a36a3f6b2cc3e9aea635d355a525a87
...
244
245
246
247
 
248
249
250
...
244
245
246
 
247
248
249
250
0
@@ -244,7 +244,7 @@ module ThoughtBot # :nodoc:
0
             @parent ||= []
0
             @parent = [@parent] unless @parent.is_a? Array
0
 
0
- collection_helper = [@parent, @object.pluralize, 'url'].flatten.join('_')
0
+ collection_helper = [@parent, @object.to_s.pluralize, 'url'].flatten.join('_')
0
             collection_args = @parent.map {|n| "@#{object}.#{n}"}.join(', ')
0
             @destroy.redirect ||= "#{collection_helper}(#{collection_args})"
0
 
...
34
35
36
37
38
 
 
39
40
41
...
49
50
51
52
 
53
54
55
...
65
66
67
68
 
69
70
71
...
34
35
36
 
 
37
38
39
40
41
...
49
50
51
 
52
53
54
55
...
65
66
67
 
68
69
70
71
0
@@ -34,8 +34,8 @@ class PostsController < ApplicationController
0
     respond_to do |format|
0
       if @post.save
0
         flash[:notice] = 'Post was successfully created.'
0
- format.html { redirect_to post_url(@post.user, @post) }
0
- format.xml { head :created, :location => post_url(@post.user, @post) }
0
+ format.html { redirect_to user_post_url(@post.user, @post) }
0
+ format.xml { head :created, :location => user_post_url(@post.user, @post) }
0
       else
0
         format.html { render :action => "new" }
0
         format.xml { render :xml => @post.errors.to_xml }
0
@@ -49,7 +49,7 @@ class PostsController < ApplicationController
0
     respond_to do |format|
0
       if @post.update_attributes(params[:post])
0
         flash[:notice] = 'Post was successfully updated.'
0
- format.html { redirect_to post_url(@post.user, @post) }
0
+ format.html { redirect_to user_post_url(@post.user, @post) }
0
         format.xml { head :ok }
0
       else
0
         format.html { render :action => "edit" }
0
@@ -65,7 +65,7 @@ class PostsController < ApplicationController
0
     flash[:notice] = "Post was removed"
0
     
0
     respond_to do |format|
0
- format.html { redirect_to posts_url(@post.user) }
0
+ format.html { redirect_to user_posts_url(@post.user) }
0
       format.xml { head :ok }
0
     end
0
   end
...
2
3
4
5
 
6
7
8
...
23
24
25
26
27
28
 
 
...
2
3
4
 
5
6
7
8
...
23
24
25
 
 
26
27
28
0
@@ -2,7 +2,7 @@
0
 
0
 <%= error_messages_for :post %>
0
 
0
-<% form_for(:post, :url => post_path(@post.user, @post), :html => { :method => :put }) do |f| %>
0
+<% form_for(:post, :url => user_post_path(@post.user, @post), :html => { :method => :put }) do |f| %>
0
   <p>
0
     <b>User</b><br />
0
     <%= f.text_field :user_id %>
0
@@ -23,5 +23,5 @@
0
   </p>
0
 <% end %>
0
 
0
-<%= link_to 'Show', post_path(@post.user, @post) %> |
0
-<%= link_to 'Back', posts_path(@post.user) %>
0
\ No newline at end of file
0
+<%= link_to 'Show', user_post_path(@post.user, @post) %> |
0
+<%= link_to 'Back', user_posts_path(@post.user) %>
...
12
13
14
15
16
17
 
 
 
 
18
19
20
21
22
23
24
25
 
...
12
13
14
 
 
 
15
16
17
18
19
20
21
22
23
24
 
25
26
0
@@ -12,13 +12,14 @@
0
     <td><%=h post.user_id %></td>
0
     <td><%=h post.title %></td>
0
     <td><%=h post.body %></td>
0
- <td><%= link_to 'Show', post_path(post.user, post) %></td>
0
- <td><%= link_to 'Edit', edit_post_path(post.user, post) %></td>
0
- <td><%= link_to 'Destroy', post_path(post.user, post), :confirm => 'Are you sure?', :method => :delete %></td>
0
+ <td><%= link_to 'Show', user_post_path(post.user, post) %></td>
0
+ <td><%= link_to 'Edit', edit_user_post_path(post.user, post) %></td>
0
+ <td><%= link_to 'Destroy', user_post_path(post.user, post), :confirm => 'Are you sure?',
0
+ :method => :delete %></td>
0
   </tr>
0
 <% end %>
0
 </table>
0
 
0
 <br />
0
 
0
-<%= link_to 'New post', new_post_path(post.user) %>
0
\ No newline at end of file
0
+<%= link_to 'New post', new_user_post_path(post.user) %>
...
2
3
4
5
 
6
7
8
...
23
24
25
26
27
 
...
2
3
4
 
5
6
7
8
...
23
24
25
 
26
27
0
@@ -2,7 +2,7 @@
0
 
0
 <%= error_messages_for :post %>
0
 
0
-<% form_for(:post, :url => posts_path(@user)) do |f| %>
0
+<% form_for(:post, :url => user_posts_path(@user)) do |f| %>
0
   <p>
0
     <b>User</b><br />
0
     <%= f.text_field :user_id %>
0
@@ -23,4 +23,4 @@
0
   </p>
0
 <% end %>
0
 
0
-<%= link_to 'Back', posts_path(@user) %>
0
\ No newline at end of file
0
+<%= link_to 'Back', user_posts_path(@user) %>
...
14
15
16
17
18
19
 
 
...
14
15
16
 
 
17
18
19
0
@@ -14,5 +14,5 @@
0
 </p>
0
 
0
 
0
-<%= link_to 'Edit', edit_post_path(@post.user, @post) %> |
0
-<%= link_to 'Back', posts_path(@post.user) %>
0
\ No newline at end of file
0
+<%= link_to 'Edit', edit_user_post_path(@post.user, @post) %> |
0
+<%= link_to 'Back', user_posts_path(@post.user) %>
...
1
2
3
 
4
5
6
...
12
13
14
15
16
 
17
18
19
20
 
21
...
1
2
 
3
4
5
6
...
12
13
14
 
 
15
16
17
 
18
19
20
0
@@ -1,6 +1,6 @@
0
 # Specifies gem version of Rails to use when vendor/rails is not present
0
 old_verbose, $VERBOSE = $VERBOSE, nil
0
-RAILS_GEM_VERSION = '1.2.3'
0
+RAILS_GEM_VERSION = '2.0.2'
0
 $VERBOSE = old_verbose
0
  
0
 require File.join(File.dirname(__FILE__), 'boot')
0
@@ -12,8 +12,7 @@ Rails::Initializer.run do |config|
0
   config.log_level = :debug
0
   config.cache_classes = false
0
   config.whiny_nils = true
0
- config.breakpoint_server = true
0
- config.load_paths << File.join(File.dirname(__FILE__), *%w{.. .. .. lib})
0
+ # config.load_paths << File.join(File.dirname(__FILE__), *%w{.. .. .. lib})
0
 end
0
  
0
-Dependencies.log_activity = true
0
\ No newline at end of file
0
+# Dependencies.log_activity = true
0
\ No newline at end of file
...
1
2
3
4
 
 
 
 
5
...
1
 
 
 
2
3
4
5
6
0
@@ -1,5 +1,6 @@
0
 ActionController::Routing::Routes.draw do |map|
0
- map.resources :users do |user|
0
- user.resources :posts
0
- end
0
+
0
+ map.resources :posts
0
+ map.resources :users, :has_many => :posts
0
+
0
 end

Comments

    No one has commented yet.