Sha256: b371819c9c41fe612488c82bff4e7b90ac8057226ded40390b7978ab2c95208a
Contents?: true
Size: 1.7 KB
Versions: 3
Compression:
Stored size: 1.7 KB
Contents
begin require 'capybara/rspec' rescue LoadError end begin require 'capybara/rails' rescue LoadError end if defined?(Capybara) module RSpec::Rails::DeprecatedCapybaraDSL include ::Capybara::DSL def self.included(mod) mod.extend(ClassMethods) super end module ClassMethods def include(mod) if mod == ::Capybara::DSL class_variable_set(:@@_rspec_capybara_included_explicitly, true) end super end end ::Capybara::DSL.instance_methods(false).each do |method| # capybara internally calls `page`, skip to avoid a duplicate # deprecation warning next if method.to_s == 'page' define_method method do |*args, &blk| unless self.class.class_variable_defined?(:@@_rspec_capybara_included_explicitly) RSpec.deprecate "Using the capybara method `#{method}` in controller specs", :replacement => "feature specs (spec/features)" end super(*args, &blk) end end end RSpec.configure do |c| if defined?(Capybara::DSL) c.include ::RSpec::Rails::DeprecatedCapybaraDSL, :type => :controller c.include Capybara::DSL, :type => :feature end if defined?(Capybara::RSpecMatchers) c.include Capybara::RSpecMatchers, :type => :view c.include Capybara::RSpecMatchers, :type => :helper c.include Capybara::RSpecMatchers, :type => :mailer c.include Capybara::RSpecMatchers, :type => :controller c.include Capybara::RSpecMatchers, :type => :feature end unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL) c.include Capybara, :type => :request c.include Capybara, :type => :controller end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rspec-rails-2.99.0 | lib/rspec/rails/vendor/capybara.rb |
rspec-rails-2.99.0.rc1 | lib/rspec/rails/vendor/capybara.rb |
rspec-rails-2.99.0.beta2 | lib/rspec/rails/vendor/capybara.rb |