Last active
December 10, 2015 01:48
-
-
Save raws/4362086 to your computer and use it in GitHub Desktop.
Use mongoid-rspec 1.5.5 with capybara 1.1.2 by aliasing a conflicting `have_field` rspec matcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fix_capybara_mongoid_matcher_conflict | |
| Capybara::RSpecMatchers.module_eval do | |
| alias :have_input :have_field | |
| end | |
| end | |
| RSpec.configure do |config| | |
| fix_capybara_mongoid_matcher_conflict | |
| config.include Mongoid::Matchers | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Unit test | |
| it { should have_field('email') } | |
| # Integration test | |
| it { should have_input('user_email') } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment