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 : 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
Original file line number Diff line number Diff line change 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
5471end
You can’t perform that action at this time.
0 commit comments