[PATCH portal 1/3] Update auth features to reflect changes in design. [PATCH portal 2/3] Extend user model. [PATCH portal 3/3] Extend new user form, initial layout fixes.
This is a subset of the patches from last week - there were some issues with changes I made to test-harness stuff which seems to have conflicted with other recently pushed patches, so I just stripped it out. Rake cucumber and spec shoudl now pass after applying these three patches (with drop/create db of course, as already discussed).
-j
These tests should now fail, next patch in series will make them pass again. They reflect where the design changes will be, so it should be easy to see much of what to look for in the next patch. --- src/features/authentication.feature | 22 +++++++++++++--------- src/features/step_definitions/authentication.rb | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/features/authentication.feature b/src/features/authentication.feature index add2c95..0dea3ac 100644 --- a/src/features/authentication.feature +++ b/src/features/authentication.feature @@ -3,16 +3,20 @@ Feature: User authentication As a user I must register and log in
+ @register Scenario: Register as new user Given I am on the homepage - When I follow "Register" + When I follow "Create one now" Then I should be on the new account page + And I should see "New Account" When I fill in the following: - | login | testuser | - | email | testuser@example.com | - | password | secret | - | password confirmation | secret | - And I press "Register" + | Choose a username | testuser | + | Choose a password | secret | + | Confirm password | secret | + | First name | Joe | + | Last name | Tester | + | Email | testuser@example.com | + And I press "Create Account" Then I should be on the account page And I should see "User registered!"
@@ -35,7 +39,7 @@ Feature: User authentication And I am on the homepage When I want to edit my profile And I follow "Edit" - Then I should see "Edit My Profile" + Then I should see "Edit my profile" When I fill in "email" with "changed@example.com" And I press "Update" Then I should be on the account page @@ -47,5 +51,5 @@ Feature: User authentication When I follow "Log out" Then I should be logged out And I should see "Logout successful!" - And I should see "Register" - And I should see "Login" + And I should see "Create one now." + And I should see "Please sign in" diff --git a/src/features/step_definitions/authentication.rb b/src/features/step_definitions/authentication.rb index e5917ce..92e7874 100644 --- a/src/features/step_definitions/authentication.rb +++ b/src/features/step_definitions/authentication.rb @@ -5,7 +5,7 @@ end def login(login, password) user visit path_to("the login page") - fill_in "Login", :with => login + fill_in "Username", :with => login fill_in "Password", :with => password click_button "Login" end
On 03/15/2010 01:57 PM, Jason Guiditta wrote:
These tests should now fail, next patch in series will make them pass again. They reflect where the design changes will be, so it should be easy to see much of what to look for in the next patch.
src/features/authentication.feature | 22 +++++++++++++--------- src/features/step_definitions/authentication.rb | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/features/authentication.feature b/src/features/authentication.feature index add2c95..0dea3ac 100644 --- a/src/features/authentication.feature +++ b/src/features/authentication.feature @@ -3,16 +3,20 @@ Feature: User authentication As a user I must register and log in
- @register Scenario: Register as new user Given I am on the homepage
- When I follow "Register"
- When I follow "Create one now" Then I should be on the new account page
- And I should see "New Account" When I fill in the following:
| login | testuser |
| email | testuser@example.com |
| password | secret |
| password confirmation | secret |
- And I press "Register"
| Choose a username | testuser |
| Choose a password | secret |
| Confirm password | secret |
| First name | Joe |
| Last name | Tester |
| Email | testuser@example.com |
- And I press "Create Account" Then I should be on the account page And I should see "User registered!"
@@ -35,7 +39,7 @@ Feature: User authentication And I am on the homepage When I want to edit my profile And I follow "Edit"
- Then I should see "Edit My Profile"
- Then I should see "Edit my profile" When I fill in "email" with "changed@example.com" And I press "Update" Then I should be on the account page
@@ -47,5 +51,5 @@ Feature: User authentication When I follow "Log out" Then I should be logged out And I should see "Logout successful!"
- And I should see "Register"
- And I should see "Login"
- And I should see "Create one now."
- And I should see "Please sign in"
diff --git a/src/features/step_definitions/authentication.rb b/src/features/step_definitions/authentication.rb index e5917ce..92e7874 100644 --- a/src/features/step_definitions/authentication.rb +++ b/src/features/step_definitions/authentication.rb @@ -5,7 +5,7 @@ end def login(login, password) user visit path_to("the login page")
- fill_in "Login", :with => login
- fill_in "Username", :with => login fill_in "Password", :with => password click_button "Login" end
ACK looks good, both 'rake spec' and 'cucumber features/authentication.feature' works. I'd remove the commit message about 'these tests should now fail' before you push though.
-Mo
--- src/db/migrate/20090917192602_create_users.rb | 2 ++ src/spec/factories/user.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/db/migrate/20090917192602_create_users.rb b/src/db/migrate/20090917192602_create_users.rb index 5b9f76e..67706fb 100644 --- a/src/db/migrate/20090917192602_create_users.rb +++ b/src/db/migrate/20090917192602_create_users.rb @@ -29,6 +29,8 @@ class CreateUsers < ActiveRecord::Migration t.string :persistence_token, :null => false t.string :single_access_token, :null => false t.string :perishable_token, :null => false + t.string :first_name + t.string :last_name # Magic columns, just like ActiveRecord's created_at and updated_at. # These are automatically maintained by Authlogic if they are present. t.integer :login_count, :null => false, :default => 0 diff --git a/src/spec/factories/user.rb b/src/spec/factories/user.rb index 1a82c72..077083b 100644 --- a/src/spec/factories/user.rb +++ b/src/spec/factories/user.rb @@ -3,8 +3,8 @@ Factory.define :user do |u| u.email 'myuser@example.com' u.password 'secret' u.password_confirmation 'secret' - #u.first_name 'John' - #u.last_name 'Smith' + u.first_name 'John' + u.last_name 'Smith' end
Factory.define :tuser, :parent => :user do |u|
On 03/15/2010 01:57 PM, Jason Guiditta wrote:
src/db/migrate/20090917192602_create_users.rb | 2 ++ src/spec/factories/user.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/db/migrate/20090917192602_create_users.rb b/src/db/migrate/20090917192602_create_users.rb index 5b9f76e..67706fb 100644 --- a/src/db/migrate/20090917192602_create_users.rb +++ b/src/db/migrate/20090917192602_create_users.rb @@ -29,6 +29,8 @@ class CreateUsers< ActiveRecord::Migration t.string :persistence_token, :null => false t.string :single_access_token, :null => false t.string :perishable_token, :null => false
t.string :first_name
t.string :last_name # Magic columns, just like ActiveRecord's created_at and updated_at. # These are automatically maintained by Authlogic if they are present. t.integer :login_count, :null => false, :default => 0
diff --git a/src/spec/factories/user.rb b/src/spec/factories/user.rb index 1a82c72..077083b 100644 --- a/src/spec/factories/user.rb +++ b/src/spec/factories/user.rb @@ -3,8 +3,8 @@ Factory.define :user do |u| u.email 'myuser@example.com' u.password 'secret' u.password_confirmation 'secret'
- #u.first_name 'John'
- #u.last_name 'Smith'
u.first_name 'John'
u.last_name 'Smith' end
Factory.define :tuser, :parent => :user do |u|
ACK this patch looks good.
-Mo
This patch takes the first step in getting the design closer to what Jeremy has in his mockups.
There will be significant overall changes that will have an entire separate css patch later, so I ignored things like having the 'cancel' link lined up under the form buttons. However, form layout should be more consistent to support upcoming changes.
cucumber tests should now pass. --- src/app/views/user_sessions/new.html.erb | 32 +++++++++++++++---------- src/app/views/users/_form.erb | 36 +++++++++++++++++++++-------- src/app/views/users/edit.html.erb | 11 ++++----- src/app/views/users/new.html.erb | 9 ++++--- src/app/views/users/show.html.erb | 2 +- src/public/stylesheets/dcloud.css | 9 +++---- 6 files changed, 60 insertions(+), 39 deletions(-)
diff --git a/src/app/views/user_sessions/new.html.erb b/src/app/views/user_sessions/new.html.erb index ee7da51..92f384c 100644 --- a/src/app/views/user_sessions/new.html.erb +++ b/src/app/views/user_sessions/new.html.erb @@ -1,18 +1,24 @@ -<div class="dcloud_form"> - <h2>Login</h2> +<h2 class="greeting">Welcome to $aggregator. Please sign in.</h2>
+<div class="dcloud_form"> <% form_for @user_session, :url => user_session_path do |f| %> <%= f.error_messages %> - <%= f.label :login %><br /> - <%= f.text_field :login %><br /> - <br /> - <%= f.label :password %><br /> - <%= f.password_field :password %><br /> - <br /> - <%= f.check_box :remember_me %><%= f.label :remember_me %><br /> - <br /> - <%= f.submit "Login" %> + <ul> + <li> + <%= f.label :login, "Username" %> + <%= f.text_field :login %> + </li> + <li> + <%= f.label :password %> + <%= f.password_field :password %> + </li> + </ul> + <%= f.check_box :remember_me %><%= f.label :remember_me %> + <%= f.submit "Login", :class => "submit" %> <% end %> - <%= link_to 'Register', {:controller => 'users', :action => 'new'}, :class => 'actionlink' %> - + <div> + <%= link_to "Don't have an account? Create one now.", + {:controller => 'users', :action => 'new'}, + :class => 'actionlink' %> + </div> </div> diff --git a/src/app/views/users/_form.erb b/src/app/views/users/_form.erb index a278d9a..4fcd98c 100644 --- a/src/app/views/users/_form.erb +++ b/src/app/views/users/_form.erb @@ -1,10 +1,26 @@ -<%= form.label :login %><br /> -<%= form.text_field :login %><br /> -<%= form.label :email %><br /> -<%= form.text_field :email %><br /> -<br /> -<%= form.label :password, form.object.new_record? ? nil : "Change password" %><br /> -<%= form.password_field :password %><br /> -<br /> -<%= form.label :password_confirmation %><br /> -<%= form.password_field :password_confirmation %><br /> +<ul> + <li> + <%= form.label :login, "Choose a username" %> + <%= form.text_field :login %> + </li> + <li> + <%= form.label :password, form.object.new_record? ? "Choose a password" : "Change password" %> + <%= form.password_field :password %> + </li> + <li> + <%= form.label :password_confirmation, "Confirm password" %> + <%= form.password_field :password_confirmation %> + </li> + <li> + <%= form.label :first_name %> + <%= form.text_field :first_name %> + </li> + <li> + <%= form.label :last_name %> + <%= form.text_field :last_name %> + </li> + <li> + <%= form.label :email %> + <%= form.text_field :email %> + </li> +</ul> diff --git a/src/app/views/users/edit.html.erb b/src/app/views/users/edit.html.erb index 73fdedd..0d2de48 100644 --- a/src/app/views/users/edit.html.erb +++ b/src/app/views/users/edit.html.erb @@ -1,11 +1,10 @@ -<div class="dcloud_form"> - <h2>Edit My Profile</h2> +<h2 class="greeting">Edit my profile.</h2>
+<div class="dcloud_form"> <% form_for @user, :url => account_path do |f| %> <%= f.error_messages %> - <%= render :partial => "form", :object => f %> - <%= f.submit "Update" %> + <%= render :partial => "form", :object => f %> + <%= f.submit "Update", :class => "submit" %> <% end %> - - <br /><%= link_to "My Profile", account_path, :class => 'actionlink' %> + <br /><%= link_to "Cancel", account_path, :class => 'actionlink' %> </div> diff --git a/src/app/views/users/new.html.erb b/src/app/views/users/new.html.erb index d6a35e4..0027ef6 100644 --- a/src/app/views/users/new.html.erb +++ b/src/app/views/users/new.html.erb @@ -1,9 +1,10 @@ -<div class="dcloud_form"> - <h2>Register</h2> +<h2 class="greeting">New Account</h2>
+<div class="dcloud_form"> <% form_for @user, :url => account_path do |f| %> <%= f.error_messages %> - <%= render :partial => "form", :object => f %> - <%= f.submit "Register" %> + <%= render :partial => "form", :object => f %> + <%= f.submit "Create Account", :class => "submit" %> <% end %> + <%= link_to "Cancel", root_path, :class => 'actionlink' %> </div> diff --git a/src/app/views/users/show.html.erb b/src/app/views/users/show.html.erb index 632b630..a505552 100644 --- a/src/app/views/users/show.html.erb +++ b/src/app/views/users/show.html.erb @@ -1,7 +1,7 @@ <div class="dcloud_form"> <h2>User Profile for <%=h @user.login %></h2> <p> - <b>Login:</b> + <b>Username:</b> <%=h @user.login %> </p>
diff --git a/src/public/stylesheets/dcloud.css b/src/public/stylesheets/dcloud.css index e2f47aa..96cb95c 100644 --- a/src/public/stylesheets/dcloud.css +++ b/src/public/stylesheets/dcloud.css @@ -14,7 +14,7 @@ fieldset { padding: 18px 0 10px 10px; }
-fieldset ul li input { +ul li input { border:2px solid #becfe4; color:#333; display:block; @@ -63,7 +63,7 @@ input, select { -moz-border-radius: 10px; -webkit-border-radius: 10px; margin-top: 54px; - width: 500px ; + width: 550px ; margin-left: auto ; margin-right: auto ; padding: 36px; @@ -89,7 +89,7 @@ input, select { display: block; float: left; padding: 3px 0 24px 0; - width: 160px; + width: 175px; font-size: 1.4em; color: #616161; } @@ -120,7 +120,6 @@ input, select {
.dcloud_form .submit { float: right; - margin-top: 18px; display: inline; clear:both; } @@ -263,4 +262,4 @@ ul#providers li ul li a:hover {
.instance_action_list li.first { border-left: none; -} +} \ No newline at end of file
On 03/15/2010 01:57 PM, Jason Guiditta wrote:
This patch takes the first step in getting the design closer to what Jeremy has in his mockups.
There will be significant overall changes that will have an entire separate css patch later, so I ignored things like having the 'cancel' link lined up under the form buttons. However, form layout should be more consistent to support upcoming changes.
cucumber tests should now pass.
src/app/views/user_sessions/new.html.erb | 32 +++++++++++++++---------- src/app/views/users/_form.erb | 36 +++++++++++++++++++++-------- src/app/views/users/edit.html.erb | 11 ++++----- src/app/views/users/new.html.erb | 9 ++++--- src/app/views/users/show.html.erb | 2 +- src/public/stylesheets/dcloud.css | 9 +++---- 6 files changed, 60 insertions(+), 39 deletions(-)
diff --git a/src/app/views/user_sessions/new.html.erb b/src/app/views/user_sessions/new.html.erb index ee7da51..92f384c 100644 --- a/src/app/views/user_sessions/new.html.erb +++ b/src/app/views/user_sessions/new.html.erb @@ -1,18 +1,24 @@ -<div class="dcloud_form"> -<h2>Login</h2> +<h2 class="greeting">Welcome to $aggregator. Please sign in.</h2>
Sorry but once again, I'm just not comfortable ACK'ing this w/ the "$" here. Functionally the patch looks fine.
-Mo
On Mon, Mar 15, 2010 at 2:41 PM, Mohammed Morsi mmorsi@redhat.com wrote:
On 03/15/2010 01:57 PM, Jason Guiditta wrote:
This patch takes the first step in getting the design closer to what Jeremy has in his mockups.
There will be significant overall changes that will have an entire separate css patch later, so I ignored things like having the 'cancel' link lined up under the form buttons. However, form layout should be more consistent to support upcoming changes.
Sorry but once again, I'm just not comfortable ACK'ing this w/ the "$" here. Functionally the patch looks fine.
-Mo
Entire series pushed. While I disagree, in the interest of keeping things moving rather than battling over a moot point, I have changed the contested text to 'Deltacloud Aggregator' and put in a server-side TODO msg.
deltacloud-devel@lists.fedorahosted.org