public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Search Repo:
Testing people views
Michael Hartl (author)
Wed Feb 20 18:42:09 -0800 2008
commit  841b5ea6431a060f343804e6960ed67523a10659
tree    c6fc4c678de4669ee20e903dc7750d8f82a21660
parent  004d0985c85408b8acc9c776334437af3b8df2f8
...
1
2
3
4
5
6
7
8
...
23
24
25
26
27
28
29
...
1
2
3
 
 
4
5
6
...
21
22
23
 
24
25
26
0
@@ -1,8 +1,6 @@
0
 class PeopleController < ApplicationController
0
   
0
   
0
-
0
- # render new.rhtml
0
   def new
0
   end
0
 
0
@@ -23,7 +21,6 @@
0
   def edit
0
   end
0
 
0
- # PUT /people/1
0
   def update
0
     respond_to do |format|
0
       if current_person.update_attributes(params[:person])
...
15
16
17
 
 
18
19
20
...
15
16
17
18
19
20
21
22
0
@@ -15,6 +15,8 @@
0
       redirect_back_or_default('/')
0
       flash[:success] = "Logged in successfully"
0
     else
0
+ flash[:error] = "Invalid email/password combination"
0
+ params[:password] = nil
0
       render :action => 'new'
0
     end
0
   end
...
1
 
2
3
4
5
 
 
 
 
 
 
6
7
8
 
 
 
 
 
9
10
11
12
13
14
 
 
 
 
 
 
 
 
...
1
2
3
 
 
 
4
5
6
7
8
9
10
 
 
11
12
13
14
15
16
 
 
 
 
 
17
18
19
20
21
22
23
24
0
@@ -1,15 +1,25 @@
0
 <%= error_messages_for :person %>
0
+
0
 <% form_for :person, :url => people_path do |f| -%>
0
-<p><label for="email">Email address</label><br/>
0
-<%= f.text_field :email %></p>
0
-<%= set_focus_to_id "person_email" %>
0
+<div class="form_row">
0
+ <label for="email">Email address (never made public)</label>
0
+ <br />
0
+ <%= f.text_field :email, :maxlength => Person::MAX_EMAIL %>
0
+ <%= set_focus_to_id "person_email" %>
0
+</div>
0
 
0
-<p><label for="password">Password</label><br/>
0
-<%= f.password_field :password %></p>
0
+<div class="form_row">
0
+ <label for="password">Password</label>
0
+ <br />
0
+ <%= f.password_field :password, :maxlength => Person::MAX_PASSWORD %>
0
+</div>
0
 
0
-<p><label for="password_confirmation">Confirm Password</label><br/>
0
-<%= f.password_field :password_confirmation %></p>
0
-
0
-<p><%= submit_tag 'Sign up' %></p>
0
-<% end -%>
0
+<div class="form_row">
0
+ <label for="password_confirmation">Confirm Password</label>
0
+ <br />
0
+ <%= f.password_field :password_confirmation,
0
+ :maxlength => Person::MAX_PASSWORD,
0
+ :value => "" %>
0
+</div>
0
+<% end %>
...
15
16
17
18
 
19
20
...
15
16
17
 
18
19
20
0
@@ -15,7 +15,7 @@
0
 <div class="form_row"><%= submit_tag 'Sign in' %> or <%= link_to "Sign up", signup_path %></div>
0
 
0
 <div class="form_row">
0
- <%# link_to "I forgot my password!", new_email_reminder_path %>
0
+ <%# TODO: link_to "I forgot my password!", new_email_reminder_path %>
0
 </div>
0
 <% end -%>
...
1
2
3
4
5
6
 
 
7
8
9
...
1
2
3
 
4
5
6
7
8
9
10
0
@@ -1,9 +1,10 @@
0
 require File.dirname(__FILE__) + '/../spec_helper'
0
 
0
 describe PeopleController do
0
- integrate_views
0
   
0
   describe "signup" do
0
+ integrate_views
0
+
0
     it 'allows signup' do
0
       lambda do
0
         create_person

Comments

    No one has commented yet.