Sha256: de893d82d78ce20a11d509036bfb8775f1179870d36ca7a9492ea3855b23d7ba

Contents?: true

Size: 523 Bytes

Versions: 30

Compression:

Stored size: 523 Bytes

Contents

require_relative "../spec_helper"

describe "symbol_views plugin" do
  before do
    app(:bare) do
      plugin :symbol_views

      def view(s)
        "v#{s}"
      end

      route do |r|
        r.root do
          :sym
        end

        r.is "string" do
          'string'
        end
      end
    end
  end

  it "should call view with the symbol" do
    body.must_equal "vsym"
  end

  it "should not affect other return types" do
    body("/string").must_equal 'string'
    body("/foo").must_equal ''
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

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