Sha256: 63f63c63b92492653e895aaff0e94f29edd780a84863054117750da1961d2a55

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

require 'draper/test/view_context'

module Draper
  module DecoratorExampleGroup
    extend ActiveSupport::Concern
    included { metadata[:type] = :decorator }
  end
end

RSpec.configure do |config|
  # Automatically tag specs in specs/decorators as type: :decorator
  config.include Draper::DecoratorExampleGroup, :type => :decorator, :example_group => {
    :file_path => /spec[\\\/]decorators/
  }

  # Specs tagged type: :decorator set the Draper view context
  config.before :type => :decorator do
    Draper::ViewContext.infect!(self)
  end
end

if defined?(Capybara)
  require 'capybara/rspec/matchers'

  RSpec.configure do |config|
    config.include Capybara::RSpecMatchers, :type => :decorator
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
draper-0.17.0 lib/draper/test/rspec_integration.rb
draper-0.16.0 lib/draper/test/rspec_integration.rb