Sha256: aa3929afc0b50d6bd79f89c242ad2ffe8289b1440e346073332346b3814ed286
Contents?: true
Size: 1.04 KB
Versions: 12
Compression:
Stored size: 1.04 KB
Contents
require 'unit_spec_helper' describe Shoulda::Matchers::ActionController::RouteParams, type: :controller do describe "#normalize" do context "when the route parameters is a hash" do it "stringifies the values in the hash" do expect(build_route_params(controller: :examples, action: 'example', id: '1').normalize). to eq({ controller: "examples", action: "example", id: "1" }) end end context "when the route parameters is a string and a hash" do it "produces a hash of route parameters" do expect(build_route_params("examples#example", id: '1').normalize). to eq({ controller: "examples", action: "example", id: "1" }) end end context "when the route params is a string" do it "produces a hash of route params" do expect(build_route_params("examples#index").normalize). to eq({ controller: "examples", action: "index"}) end end end def build_route_params(*params) Shoulda::Matchers::ActionController::RouteParams.new(params) end end
Version data entries
12 entries across 12 versions & 2 rubygems