Skip to content

Commit 16a7abb

Browse files
committed
Added usernames.
We now have usernames for individual accounts.
1 parent 747fe99 commit 16a7abb

5 files changed

Lines changed: 22 additions & 2 deletions

File tree

features/support/paths.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def path_to(page_name)
3232
when /a blog post page/
3333
post = Post.first
3434
"/posts/#{post.id}"
35+
when /the new user page/
36+
"/signup"
37+
when /the main page/
38+
"/"
3539

3640
# Add more mappings here.
3741
# Here is an example that pulls values out of the Regexp:

features/user.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Feature: User management
2+
Scenario: Users can register
3+
Given I'm not logged in
4+
And I go to the new user page
5+
And I fill in "Email" with "steve@example.com"
6+
And I fill in "Username" with "steve"
7+
And I fill in "Password" with "foobar"
8+
And I fill in "Confirm Password" with "foobar"
9+
When I press "Create account"
10+
Then I should see "Account created."
11+
And I should be on the main page

models/mm_user.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class MmUser
2+
key :username, String
3+
end

models/user.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

views/auth/signup.haml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
.label
88
%label{:for => "user_email"} Email
99
%input{ :id => "user_email", :name => "user[email]", :size => 30, :type => "text" }
10+
.field
11+
.label
12+
%label{:for => "user_username"} Username
13+
%input{ :id => "user_username", :name => "user[username]", :size => 30, :type => "text" }
1014
.field
1115
.label
1216
%label{:for => "user_password"} Password

0 commit comments

Comments
 (0)