Guest User

Untitled

a guest
May 25th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Given /I am on the new keyword page/ do
  2. visits "/keywords/new"
  3. end
  4.  
  5. Given /there are (\d+) keywords/ do |n|
  6. Keyword.transaction do
  7. Keyword.destroy_all
  8. n.to_i.times do |n|
  9. Keyword.create! :name => "Keyword #{n}"
  10. end
  11. end
  12. end
  13.  
  14.  
  15. When /I delete the first keyword/ do
  16. visits keywords_url
  17. clicks_link "Del"
  18. end
  19.  
  20. Then /there should be (\d+) keywords left/ do |n|
  21. Keyword.count.should == n.to_i
  22. response.should have_tag("ul#keywords_list li", n.to_i)
  23. end
  24.  
  25.  
  26. Given /^I am logged in(?:\sas\san\s)?(.*)$/i do |user_type|
  27.  
  28. case user_type.downcase
  29. when 'admin'
  30. email = 'admin@example.com'
  31. else
  32. email = 'user@example.com'
  33. end
  34.  
  35. visits '/signup'
  36. fills_in('Beta code', :with => BETA_CODE)
  37. fills_in('Login', :with => 'username')
  38. fills_in('Email', :with => email)
  39. fills_in('Password', :with => 'password')
  40. fills_in('Confirm Password', :with => 'password')
  41. clicks_button 'Sign up'
  42. end
Add Comment
Please, Sign In to add comment