Sha256: 5b4e5069994ba10dd9158ad2c8849c21c16d2ece3e05d629fc5171a5eaec456a

Contents?: true

Size: 677 Bytes

Versions: 30

Compression:

Stored size: 677 Bytes

Contents

require_relative "../spec_helper"

describe "static plugin" do 
  it "adds support for serving static files" do
    app(:bare) do
      plugin :static, ['/about'], :root=>'spec/views'

      route do
        'a'
      end
    end

    body.must_equal 'a'
    body('/about/_test.erb').must_equal File.read('spec/views/about/_test.erb')
  end

  it "respects the application's :root option" do
    app(:bare) do
      opts[:root] = File.expand_path('../../', __FILE__)
      plugin :static, ['/about'], :root=>'views'

      route do
        'a'
      end
    end

    body.must_equal 'a'
    body('/about/_test.erb').must_equal File.read('spec/views/about/_test.erb')
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

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