Sha256: 5cd1b0dae47698e4ea8be1f0f28eec7241604ea8caf2eccd36d2dd9173d3015f
Contents?: true
Size: 873 Bytes
Versions: 18
Compression:
Stored size: 873 Bytes
Contents
require 'spec_helper' module RailsBestPractices::Core describe Routes do let(:routes) { Routes.new } it "should add route" do routes.add_route(["admin", "test"], "posts", "new") routes.map(&:to_s).should == ["Admin::Test::PostsController#new"] end context "route" do it "should add namesapces, controller name and action name" do route = Route.new(['admin', 'test'], 'posts', 'new') route.to_s.should == "Admin::Test::PostsController#new" end it "should add controller name with namespace" do route = Route.new(['admin'], 'test/posts', 'new') route.to_s.should == "Admin::Test::PostsController#new" end it "should add routes without controller" do route = Route.new(['posts'], nil, 'new') route.to_s.should == "PostsController#new" end end end end
Version data entries
18 entries across 18 versions & 1 rubygems