Sha256: 9d4cb4a76c0f4f18ea818c310ce36e4fa595bea9ae35ab4c0f3e6c414ee380dc

Contents?: true

Size: 499 Bytes

Versions: 24

Compression:

Stored size: 499 Bytes

Contents

require_relative "../spec_helper"

describe "early_hints plugin" do 
  it "allows sending early hints to rack.early_hints" do
    queue = []
    app(:early_hints) do |r|
      send_early_hints('Link'=>'</foo.js>; rel=preload; as=script')
      queue << 'OK'
      'OK'
    end

    body.must_equal 'OK'
    queue.must_equal ['OK']

    queue = []
    body('rack.early_hints'=>proc{|h| queue << h}).must_equal 'OK'
    queue.must_equal [{'Link'=>'</foo.js>; rel=preload; as=script'}, 'OK']
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
roda-3.28.0 spec/plugin/early_hints_spec.rb
roda-3.27.0 spec/plugin/early_hints_spec.rb
roda-3.26.0 spec/plugin/early_hints_spec.rb
roda-3.25.0 spec/plugin/early_hints_spec.rb
roda-3.24.0 spec/plugin/early_hints_spec.rb
roda-3.23.0 spec/plugin/early_hints_spec.rb
roda-3.22.0 spec/plugin/early_hints_spec.rb
roda-3.21.0 spec/plugin/early_hints_spec.rb
roda-3.20.0 spec/plugin/early_hints_spec.rb
roda-3.19.0 spec/plugin/early_hints_spec.rb
roda-3.18.0 spec/plugin/early_hints_spec.rb
roda-3.17.0 spec/plugin/early_hints_spec.rb
roda-3.16.0 spec/plugin/early_hints_spec.rb
roda-3.15.0 spec/plugin/early_hints_spec.rb
roda-3.14.1 spec/plugin/early_hints_spec.rb
roda-3.14.0 spec/plugin/early_hints_spec.rb
roda-3.13.0 spec/plugin/early_hints_spec.rb
roda-3.12.0 spec/plugin/early_hints_spec.rb
roda-3.11.0 spec/plugin/early_hints_spec.rb
roda-3.10.0 spec/plugin/early_hints_spec.rb