Sha256: 40f48e05768774b0f2d4814491125f70d910b79e5449d497a8ca60e7ecce6c02

Contents?: true

Size: 567 Bytes

Versions: 28

Compression:

Stored size: 567 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__)))

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

28 entries across 28 versions & 1 rubygems

Version Path
roda-2.29.0 spec/plugin/symbol_views_spec.rb
roda-2.28.0 spec/plugin/symbol_views_spec.rb
roda-2.27.0 spec/plugin/symbol_views_spec.rb
roda-2.26.0 spec/plugin/symbol_views_spec.rb
roda-2.25.0 spec/plugin/symbol_views_spec.rb
roda-2.24.0 spec/plugin/symbol_views_spec.rb
roda-2.23.0 spec/plugin/symbol_views_spec.rb
roda-2.22.0 spec/plugin/symbol_views_spec.rb
roda-2.21.0 spec/plugin/symbol_views_spec.rb
roda-2.20.0 spec/plugin/symbol_views_spec.rb
roda-2.19.0 spec/plugin/symbol_views_spec.rb
roda-2.18.0 spec/plugin/symbol_views_spec.rb
roda-2.17.0 spec/plugin/symbol_views_spec.rb
roda-2.16.0 spec/plugin/symbol_views_spec.rb
roda-2.15.0 spec/plugin/symbol_views_spec.rb
roda-2.14.0 spec/plugin/symbol_views_spec.rb
roda-2.13.0 spec/plugin/symbol_views_spec.rb
roda-2.12.0 spec/plugin/symbol_views_spec.rb
roda-2.11.0 spec/plugin/symbol_views_spec.rb
roda-2.10.0 spec/plugin/symbol_views_spec.rb