Skip to content

Instantly share code, notes, and snippets.

@rbatta
Last active December 21, 2015 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbatta/6276694 to your computer and use it in GitHub Desktop.
Save rbatta/6276694 to your computer and use it in GitHub Desktop.
Cucumber error ...?
Background: users in database # features/article_merging.feature:7
Given the blog is created for the following users: # features/step_definitions/web_steps.rb:34
| login | password | email | profile_id | name | state |
| admin | password | b@example.com | 1 | bob | active |
| user1 | password | c@example.com | 2 | fred | active |
/home/ubuntu/Documents/CS169.2/typo/features/step_definitions/web_steps.rb:47
fill_in 'user_login', with: User.find_by_name(person).login
(rdb:1) c
And I log in as bob # features/step_definitions/web_steps.rb:44
expected there to be content "Login successful" in "Teh Blag - login\n \n \n \n Teh Blag\n \n \n \n\t\t\n \n \n \n \n\t \n\t \tLogin\n\t \n ×Login unsuccessful\n \n \n \n \n \n Remember me \n \t \n \n \n • I've lost my password\n \n \n \n \n\n\t\t\n " (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:52:in `/^I log in as (.*)$/'
features/article_merging.feature:13:in `And I log in as bob'
Background: users in database
Given the blog is created for the following users:
| login | password | email | profile_id | name | state |
| admin | password | b@example.com | 1 | bob | active |
| user1 | password | c@example.com | 2 | fred | active |
And I log in as bob
Given /the blog is created for the following users/ do |users_table|
users_table.hashes.each do |user|
Blog.default.update_attributes!({:blog_name => 'Teh Blag',
:base_url => 'http://localhost:3000'});
Blog.default.save!
User.create!(user)
end
end
And /^I log in as (.*)$/ do |person|
visit '/accounts/login'
save_and_open_page
debugger
fill_in 'user_login', with: User.find_by_name(person).login
fill_in 'user_password', with: User.find_by_name(person).password
click_button 'Login'
if page.respond_to? :should
page.should have_content('Login successful')
else
assert page.has_content?('Login successful')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment