File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Feature : The Hackety Forum
2- Scenario : View discussions in a forum
3- Given I'm logged in
4- And there's a discussion named "I need help!" in "learning_ruby"
5- When I go to the forums
6- And I follow "Learning Ruby"
7- Then I should see "I need help!"
82 Scenario : View replies to a discussion
93 Given I'm logged in
104 And there's a discussion named "I need help" in "learning_ruby" with a reply
Original file line number Diff line number Diff line change 1313 page . should have_content "Clubhouse"
1414 end
1515
16+ scenario "can view discussions" do
17+ @hacker = Factory ( :hacker )
18+ log_in @hacker
19+
20+ title = "I need help!"
21+ Factory ( :discussion , :title => title , :forum => "learning_ruby" )
22+
23+ visit "/forums"
24+ click_link "Learning Ruby"
25+ page . should have_content "I need help!"
26+ end
27+
1628end
Original file line number Diff line number Diff line change 2626 p . title { Factory . next ( :program_title ) }
2727 p . code "puts 'hello world'"
2828end
29+
30+ Factory . define :discussion do |d |
31+ d . forum "learning_ruby"
32+ d . title "A discussion"
33+ d . author "jane_hacker"
34+ d . author_email "jane_hacker@example.com"
35+ end
36+ Factory . define :discussion_with_reply , :parent => :discussion do |t |
37+ t . replies { |r | [ Factory ( :reply ) ] }
38+ end
39+
40+ Factory . define :reply do |r |
41+ r . body "I'm here to help!"
42+ r . author "john_hacker"
43+ r . author_email "john_hacker@example.com"
44+ end
45+
You can’t perform that action at this time.
0 commit comments