2011-06-30 18:19:48 -04:00
|
|
|
require 'bundler/setup'
|
2013-01-16 21:36:56 -05:00
|
|
|
require 'draper'
|
|
|
|
|
|
|
|
RSpec.configure do |config|
|
|
|
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
|
|
|
config.expect_with(:rspec) {|c| c.syntax = :expect}
|
|
|
|
config.order = :random
|
|
|
|
end
|
|
|
|
|
|
|
|
class Model; include Draper::Decoratable; end
|
|
|
|
|
|
|
|
class Product < Model; end
|
|
|
|
class ProductDecorator < Draper::Decorator; end
|
|
|
|
class ProductsDecorator < Draper::CollectionDecorator; end
|
|
|
|
|
|
|
|
class ProductPresenter < Draper::Decorator; end
|
|
|
|
|
|
|
|
class OtherDecorator < Draper::Decorator; end
|
|
|
|
|
|
|
|
module Namespaced
|
|
|
|
class Product < Model; end
|
|
|
|
class ProductDecorator < Draper::Decorator; end
|
|
|
|
|
|
|
|
class OtherDecorator < Draper::Decorator; end
|
|
|
|
end
|
|
|
|
|
|
|
|
# After each example, revert changes made to the class
|
|
|
|
def protect_class(klass)
|
|
|
|
before { stub_const klass.name, Class.new(klass) }
|
|
|
|
end
|