Sha256: b8f549279ddb4dc5af7c47e99f974bf164456b507a82b941c8e7943ee0e4a13a

Contents?: true

Size: 553 Bytes

Versions: 8

Compression:

Stored size: 553 Bytes

Contents

module VersionCake
  module TestHelpers
    # Test helper the mimics the middleware because we do not
    # have middleware during tests.
    def set_request_version(resource, version, config=VersionCake.config)
      service = VersionCake::VersionContextService.new(config)
      @request.env['versioncake.context'] = service.create_context resource, version
    end

    def set_version_context(status, resource=nil, version=nil)
      @request.env['versioncake.context'] = VersionCake::VersionContext.new(version, resource, status)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
versioncake-4.1.1 lib/versioncake/test_helpers.rb
versioncake-4.1.0 lib/versioncake/test_helpers.rb
versioncake-4.0.2 lib/versioncake/test_helpers.rb
versioncake-4.0.1 lib/versioncake/test_helpers.rb
versioncake-4.0.0 lib/versioncake/test_helpers.rb
versioncake-3.4.0 lib/versioncake/test_helpers.rb
versioncake-3.3.0 lib/versioncake/test_helpers.rb
versioncake-3.2.0 lib/versioncake/test_helpers.rb