Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Ch 8. Feature spec works without find method #61

Open
JunichiIto opened this issue May 3, 2015 · 0 comments
Open

Ch 8. Feature spec works without find method #61

JunichiIto opened this issue May 3, 2015 · 0 comments

Comments

@JunichiIto
Copy link

users_spec uses find method:

    expect{
      click_link 'Users'
      click_link 'New User'
      fill_in 'Email', with: '[email protected]'
      find('#password').fill_in 'Password', with: 'secret123'
      find('#password_confirmation').fill_in 'Password confirmation',
        with: 'secret123'
      click_button 'Create User'
    }.to change(User, :count).by(1)

However it works without it:

    expect{
      click_link 'Users'
      click_link 'New User'
      fill_in 'Email', with: '[email protected]'
      fill_in 'Password', with: 'secret123'
      fill_in 'Password confirmation', with: 'secret123'
      click_button 'Create User'
    }.to change(User, :count).by(1)

Please consider another example for the usage of find. (Sorry, I have no idea now.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant