Skip to content

Commit 2e2e38d

Browse files
committed
Spec route_instance_path
1 parent 7909a8c commit 2e2e38d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/unit/resource/routes_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ def config(options = {})
1616
it "should return the route prefix" do
1717
config.route_prefix.should == "admin"
1818
end
19+
1920
it "should return the route collection path" do
2021
config.route_collection_path.should == "/admin/categories"
2122
end
2223

24+
it "should return the route instance path" do
25+
category = Category.new { |c| c.id = 123 }
26+
config.route_instance_path(category).should == "/admin/categories/123"
27+
end
28+
2329
context "when in the root namespace" do
2430
let(:config){ application.register Category, :namespace => false}
2531
it "should have a nil route_prefix" do

0 commit comments

Comments
 (0)