Sha256: e7ec4e95655fa31d6b7ae83b97cbf11c05ccb203e5a0cf772a167f917442b01e
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
# -*- encoding: utf-8 -*- require 'spec_helper' module HappyHelpers module Helpers describe Html do include Html describe "#url_for" do it "generates a url from an array of strings" do url_for('foo', 'bar', '123').should == '/foo/bar/123' end it "removes duplicate dashes" do url_for('/foo/', 'bar').should == '/foo/bar' end it "removes leading dashes" do url_for('foo/').should == '/foo' end it "returns just a slash if no parameters are given" do url_for().should == '/' end it "doesn't take nil into account" do url_for('foo', nil, 'bar').should == '/foo/bar' end it "also accepts symbols" do url_for(:foo, 'bar').should == '/foo/bar' end it "generates RESTful URLs from objects" do url_for(mock(:class => 'thingy', :to_param => '1')).should == '/thingies/1' end it "is can be cascaded" do url_for(url_for(:foo, :bar), '123', url_for('woop')).should == '/foo/bar/123/woop' end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
happy-helpers-0.1.0.pre7 | spec/helpers/html_spec.rb |