A website template with lots of features, built with ruby on rails.

helper_steps.rb 849B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Then(/^I should see in the field "(.*?)" the text "(.*?)"$/) do |arg1, arg2|
  2. value = find_field(arg1).value
  3. value.should have_content(arg2)
  4. end
  5. Given(/^the website is configured$/) do
  6. configs = Info.all
  7. configs.each do |config|
  8. config.destroy
  9. end
  10. FactoryGirl.create(:info)
  11. end
  12. Given(/^Maintenance mode is activated$/) do
  13. Info.last.update(maintenance_mode: true, maintenance_title: 'Website under maintenance', maintenance_message: 'Please check back soon')
  14. end
  15. Given /^the following (.+) list ?$/ do |factory, table|
  16. table.hashes.each do |hash|
  17. FactoryGirl.create(factory, hash)
  18. end
  19. end
  20. Then(/^spit out the page HTML$/) do
  21. puts page.html
  22. end
  23. When /^I go to (.+)$/ do |page_name|
  24. path_to(page_name)
  25. end
  26. Given /^I visit the "(.*)"/ do |place|
  27. visit "/#{place}"
  28. end
  29. When /^I visit the homepage$/ do
  30. visit ""
  31. end