Skip to content

Commit 7c44ae1

Browse files
committed
messages can be sent
1 parent f57d1bf commit 7c44ae1

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

features/messages.feature

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
Feature: Messages
2-
Scenario: I can send a message
3-
Given I'm logged in
4-
And there's a hacker with the username "fela"
5-
And I go to the hacker page for "fela"
6-
When I follow "Send fela a message"
7-
And I fill in "Message text" with "Hello, fela!"
8-
And I press "Send message"
9-
Then I should be on the hacker page for "fela"
10-
And I should see "Message sent."
112
Scenario: I can't send a message when not logged in
123
Given I'm not logged in
134
And there's a hacker with the username "fela"

spec/acceptance/messages_spec.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
require File.dirname(__FILE__) + '/acceptance_helper'
2+
3+
feature "Messages" do
4+
5+
background do
6+
Pony.should_receive(:deliver)
7+
end
8+
9+
scenario "can be sent" do
10+
@hacker = Factory(:hacker)
11+
log_in @hacker
12+
13+
@fela = Factory(:hacker, :username => "fela")
14+
15+
visit "/hackers/fela"
16+
17+
click_link "Send fela a message"
18+
fill_in "Message text", :with => "Hello, fela!"
19+
20+
click_button "Send message"
21+
22+
should_be_on "/hackers/fela"
23+
page.should have_content "Message sent."
24+
end
25+
end

0 commit comments

Comments
 (0)