From 1da2acc5a2b9cd518b57f13ec9927333d6e7cfa8 Mon Sep 17 00:00:00 2001 From: francis Date: Tue, 13 Nov 2007 12:15:46 +0000 Subject: Test that you can use old short name for public bodies in URLs. --- spec/controllers/body_controller_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'spec/controllers/body_controller_spec.rb') diff --git a/spec/controllers/body_controller_spec.rb b/spec/controllers/body_controller_spec.rb index bf73a6e19..1dcc6d345 100644 --- a/spec/controllers/body_controller_spec.rb +++ b/spec/controllers/body_controller_spec.rb @@ -1,7 +1,7 @@ require File.dirname(__FILE__) + '/../spec_helper' describe BodyController, "when showing a body" do - fixtures :public_bodies + fixtures :public_bodies, :public_body_versions it "should be successful" do get :show, :simple_short_name => "dfh" @@ -17,6 +17,11 @@ describe BodyController, "when showing a body" do get :show, :simple_short_name => "dfh" assigns[:public_bodies].should == [ public_bodies(:humpadink_public_body) ] end + + it "should redirect to newest name if you use historic name of public body in URL" do + get :show, :simple_short_name => "hdink" + response.should redirect_to(:controller => 'body', :action => 'show', :simple_short_name => "dfh") + end # XXX test for 404s when don't give valid name # XXX test the fancy history searching stuff -- cgit v1.2.3