1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- include Warden::Test::Helpers
- Info.create( :website_name => 'Website', :tagline => 'A Ruby on Rails app template', :default_language => 'en' )
- Given /^the following (.+) list ?$/ do |factory, table|
- user = FactoryGirl.create(:user)
- table.hashes.each do |hash|
- post = FactoryGirl.create(factory, hash)
- post.author = user
- post.save
- end
- end
-
- Given /^I have blog posts titled (.+)$/ do |titles|
- titles.split(', ').each do |title|
- BlogPost.create!(:title => title)
- end
- end
- When /^I go to (.+)$/ do |page_name|
- path_to(page_name)
- end
- Then(/^The current url should be "(.*?)"$/) do |arg1|
- uri = URI.parse(current_url)
- "#{uri.path}".should == arg1
- end
- Then(/^I should see "(.*?)"$/) do |arg1|
- page.should have_content(arg1)
- end
- Then(/^I should not see "(.*?)"$/) do |arg1|
- page.should have_no_content(arg1)
- end
- Then(/^I should see the link "(.*?)"$/) do |arg1|
- find_link(arg1).visible?
- end
- Then(/^I should not see the link "(.*?)"$/) do |arg1|
- assert has_no_link?(arg1)
- end
- Then(/^I should see "(.*?)" And I should see "(.*?)"$/) do |arg1, arg2|
- page.should have_content(arg1)
- page.should have_content(arg2)
- end
- Then(/^the page should have a "(.*?)" called "(.*?)"$/) do |arg1, arg2|
- selector = arg1 + '#' + arg2
- page.should have_css(selector)
- end
- Then(/^the page should not have a "(.*?)" called "(.*?)"$/) do |arg1, arg2|
- selector = arg1 + '#' + arg2
- page.should have_no_css(selector)
- end
- When(/^I click in the link "(.*?)"$/) do |arg1|
- click_link arg1
- end
- When(/^I click in the button "(.*?)"$/) do |arg1|
- click_button arg1
- end
- Then(/^I fill in "(.*?)" with "(.*?)"$/) do |arg1, arg2|
- fill_in arg1, :with => arg2
- end
|