Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Actually, the steps for the above test are spread throughout more pertinently-names step files.
- # For convenience sake, I added a bunch of sample steps here.
- When /^I login as "([^"]*)"( and "([^"]*)")?$/ do |login, stuff, pw|
- @login_name = login
- password = pw
- user = Account.where(:login => login).first
- password = user.password if user and pw.blank?
- visit login_path
- fill_in "login", :with => login
- fill_in "password", :with => password
- click_button "login_button"
- end
- And /^I should be able to click on "([^"]*)" and see "([^"]*)"$/ do |link, expected|
- click_link link
- response.should contain expected
- end
- Then /^(?:|I )should see "([^"]*)"$/ do |text|
- if response.respond_to? :should
- response.should contain(text)
- else
- assert_contain text
- end
- end
- And /^I click on "([^"]*)"$/ do |link|
- click_link link
- end
- When /^I search for "([^"]*)"$/ do |search_term|
- fill_in :search_field, :with => search_term
- click_button "search"
- end
- Then /^I should be able to see "([^"]*)"$/ do |expected|
- response.should contain expected
- end
- When /^I search by "([^"]*)" for "([^"]*)"$/ do |search_type, search_term|
- fill_in search_type, :with => search_term
- click_button "search"
- end
Add Comment
Please, Sign In to add comment