File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,4 +19,14 @@ Feature: CRUD actions for question
1919 And I should see "Created by test"
2020
2121 Scenario : Edit an existing question
22- Given I have created a question
22+ Given I have created a question with title "My Title" and description "My Description"
23+ And I am on the questions index
24+ When I follow "Edit" within "table"
25+ And I fill in the following:
26+ | Title | My Edited Question |
27+ | Description | My Edited Description |
28+ And I press "Ask Everyone"
29+ Then I should see "Question was successfully updated."
30+ And I should see "My Edited Question" within ".title"
31+ And I should see "My Edited Description" within ".description"
32+
Original file line number Diff line number Diff line change 1- Given /^I have created a question$/ do
2- pending
1+ Given /^I have created a question with title "([^"]*)" and description "([^"]*)" $/ do | title , description |
2+ @user . questions . build ( :title => " #{ title } " , :description => " #{ description } " ) . save!
33end
44
55Given /^there are existing questions$/ do
66 2 . times { Fabricate ( :question ) }
7- end
7+ end
8+
Original file line number Diff line number Diff line change 33end
44
55Given /^I am a user with username "([^"]*)" and password "([^"]*)"$/ do |username , password |
6- User . new ( :username => username ,
6+ @user = User . new ( :username => username ,
77 :email => "#{ username } @example.com" ,
88 :password => password ,
9- :password_confirmation => password ) . save!
9+ :password_confirmation => password )
10+ @user . save!
1011end
1112
1213Then /^I should be already signed in$/ do
You can’t perform that action at this time.
0 commit comments