Skip to content

Instantly share code, notes, and snippets.

@raws
Last active December 10, 2015 01:48
Show Gist options
  • Select an option

  • Save raws/4362086 to your computer and use it in GitHub Desktop.

Select an option

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
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
# 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