Skip to content

Commit cea51ec

Browse files
committed
making new discussions
1 parent 289c92a commit cea51ec

2 files changed

Lines changed: 18 additions & 13 deletions

File tree

features/forum.feature

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
Feature: The Hackety Forum
2-
Scenario: Make a new discussion
3-
Given I'm logged in as "some_hacker"
4-
And I go to the forums
5-
And I follow "Learning Ruby"
6-
When I follow "New Discussion"
7-
And I fill in "Title" with "HALP!"
8-
And I fill in "Body" with "I'm really unsure as to how to do something."
9-
And I press "Submit"
10-
Then I should be on the discussion "halp" in "learning_ruby"
11-
And I should see "Discussion created!"
12-
And I should see "HALP!"
13-
And I should see "By some_hacker"
142
Scenario: Can't make discussions when logged out
153
Given I'm not logged in
164
And I go to the forums

spec/acceptance/forum_spec.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,24 @@
4848
should_be_on "/forums/learning_ruby/i_need_help"
4949
page.should have_content "Replied!"
5050
page.should have_content "I'll help you"
51-
page.should have_content "steve says:"
51+
page.should have_content "#{@hacker.username} says:"
52+
end
53+
54+
scenario "make a new discussion" do
55+
@hacker = Factory(:hacker)
56+
log_in @hacker
57+
58+
visit "/forums/learning_ruby"
59+
click_link "New Discussion"
60+
61+
fill_in "Title", :with => "HALP!"
62+
fill_in "Body", :with => "I'm really unsure as to how to do something."
63+
click_button "Submit"
64+
65+
should_be_on "/forums/learning_ruby/halp"
66+
page.should have_content "Discussion created!"
67+
page.should have_content "HALP!"
68+
page.should have_content "By #{@hacker.username}"
5269
end
5370

5471
end

0 commit comments

Comments
 (0)