diff options
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 |