diff options
author | francis <francis> | 2007-11-13 12:15:46 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-13 12:15:46 +0000 |
commit | 1da2acc5a2b9cd518b57f13ec9927333d6e7cfa8 (patch) | |
tree | aa36c3c74b7ef180dd0ea1481bba7792c7c4febe /spec/controllers/body_controller_spec.rb | |
parent | 30592f486d1c9c01afb5fa04be24030c6a812376 (diff) |
Test that you can use old short name for public bodies in URLs.
Diffstat (limited to 'spec/controllers/body_controller_spec.rb')
-rw-r--r-- | spec/controllers/body_controller_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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 |