Skip to content

Commit 6b3ce8c

Browse files
committed
Link to your profile appears on main page.
Also, the log in steps were a bit ambiguous, so I moved the ones based on emails to explicitly say that.
1 parent 647903a commit 6b3ce8c

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

features/blog.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Feature: The Hackety Blog
4848
And I go to the edit post page for the post with the title "First Post"
4949
Then I should see "Sorry, buddy"
5050
Scenario: Logged in Users can comment on the blog
51-
Given I'm logged in as "awesome@example.com"
51+
Given I'm logged in as a user with the email "awesome@example.com"
5252
And there is a blog post
5353
When I go to a blog post page
5454
And I fill in "Speak your mind:" with "This post is amazing!"

features/step_definitions/common_steps.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ def login hacker
3131
login hacker
3232
end
3333

34-
Given /^I'm logged in as "([^"]*)"$/ do |email|
34+
Given /^I'm logged in as "([^"]*)"$/ do |username|
35+
password = "foobar"
36+
hacker = Factory(:hacker,:username => username, :password => password, :password_confirmation => password)
37+
login hacker
38+
end
39+
40+
Given /^I'm logged in as a user with the email "([^"]*)"$/ do |email|
3541
password = "foobar"
3642
hacker = Factory(:hacker,:email => email, :password => password, :password_confirmation => password)
3743
login hacker

features/user.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ Feature: User management
2424
Given there's a hacker with the username "steve"
2525
When I go to the hacker page for "steve"
2626
Then I should see "steve's page"
27+
Scenario: Going to your profile
28+
Given I'm logged in as "steve"
29+
And I go to the home page
30+
When I follow "Your Page"
31+
Then I should be on the hacker page for "steve"

views/layout.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
%a{:href => "http://github.com/hacketyhack/hacketyhack"}Help \
1313
%a{:href => "/forums"}Forums \
1414
- if logged_in?
15+
%a{:href => "/hackers/#{current_user.username}" }Your Page \
1516
%a{:href => "/logout" }Log out
1617
- else
1718
%a{:href => "/signup" }Sign Up \

0 commit comments

Comments
 (0)