Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Given /I am on the new keyword page/ do
- visits "/keywords/new"
- end
- Given /there are (\d+) keywords/ do |n|
- Keyword.transaction do
- Keyword.destroy_all
- n.to_i.times do |n|
- Keyword.create! :name => "Keyword #{n}"
- end
- end
- end
- When /I delete the first keyword/ do
- visits keywords_url
- clicks_link "Del"
- end
- Then /there should be (\d+) keywords left/ do |n|
- Keyword.count.should == n.to_i
- response.should have_tag("ul#keywords_list li", n.to_i)
- end
- Given /^I am logged in(?:\sas\san\s)?(.*)$/i do |user_type|
- case user_type.downcase
- when 'admin'
- email = 'admin@example.com'
- else
- email = 'user@example.com'
- end
- visits '/signup'
- fills_in('Beta code', :with => BETA_CODE)
- fills_in('Login', :with => 'username')
- fills_in('Email', :with => email)
- fills_in('Password', :with => 'password')
- fills_in('Confirm Password', :with => 'password')
- clicks_button 'Sign up'
- end
Add Comment
Please, Sign In to add comment