Sha256: 2d49fe89a5ae5ed68b12177da8e0bc6cf421ee7888212ad545daf4e1d64022c3
Contents?: true
Size: 518 Bytes
Versions: 15
Compression:
Stored size: 518 Bytes
Contents
require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__))) describe "match_affix plugin" do it "allows changing the match prefix/suffix" do app(:bare) do plugin :match_affix, "", /(\/|\z)/ route do |r| r.on "/albums" do |b| r.on "b/:id" do |id, s| "b-#{b}-#{id}-#{s.inspect}" end "albums-#{b}" end end end body("/albums/a/1").must_equal 'albums-/' body("/albums/b/1").must_equal 'b-/-1-""' end end
Version data entries
15 entries across 15 versions & 1 rubygems