vfonic/liquid4-rails5

View on GitHub
lib/liquid-rails/rspec/tag_example_group.rb

Summary

Maintainability
A
35 mins
Test Coverage
module Liquid
  module Rails
    module Rspec
      module TagExampleGroup
        extend ActiveSupport::Concern
        include Liquid::Rails::Rspec::ViewControllerContext

        included do
          metadata[:type] = :tag

          before(:all) { setup_view_and_controller }
        end
      end
    end
  end
end

RSpec.configure do |config|
  if RSpec::Core::Version::STRING.starts_with?('3')
    config.include Liquid::Rails::Rspec::TagExampleGroup, type: :tag, file_path: %r(spec/tags)
  else
    config.include Liquid::Rails::Rspec::TagExampleGroup, type: :tag, example_group: { file_path: %r{spec/tags} }
  end
end