lib/wcc/contentful/rspec.rb in wcc-contentful-1.2.0 vs lib/wcc/contentful/rspec.rb in wcc-contentful-1.2.1
- old
+ new
@@ -11,12 +11,10 @@
##
# Builds out a fake Contentful entry for the given content type, and then
# stubs the Model API to return that content type for `.find` and `.find_by`
# query methods.
def contentful_stub(const, **attrs)
- unless const.respond_to?(:content_type_definition)
- const = WCC::Contentful::Model.resolve_constant(const.to_s)
- end
+ const = WCC::Contentful::Model.resolve_constant(const.to_s) unless const.respond_to?(:content_type_definition)
instance = contentful_create(const, **attrs)
# mimic what's going on inside model_singleton_methods.rb
# find, find_by, etc always return a new instance from the same raw
allow(WCC::Contentful::Model).to receive(:find)