Skip to content

Commit b8a89d0

Browse files
committed
Can't send a message unless you're logged in.
1 parent 07dd97b commit b8a89d0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

features/messages.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ Feature: Messages
88
And I press "Send message"
99
Then I should be on the hacker page for "fela"
1010
And I should see "Message sent."
11+
Scenario: I can't send a message when not logged in
12+
Given I'm not logged in
13+
And there's a hacker with the username "fela"
14+
When I go to the hacker page for "fela"
15+
Then I should not see "Send fela a message"

views/hackers/show.haml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
%p= @hacker.username + "'s page"
22

3-
%a{:href => "/messages/new/to/#{@hacker.username}" }= "Send #{@hacker.username} a message"
3+
- if logged_in?
4+
%a{:href => "/messages/new/to/#{@hacker.username}" }= "Send #{@hacker.username} a message"

0 commit comments

Comments
 (0)