From 438367a13ae31fb7ebcc30bf4a9e82ec7e9f78a7 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Tue, 12 Jul 2011 10:51:30 +0100 Subject: Improve factoring out of custom states code (refactor a little, add tests) --- spec/controllers/request_controller_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/controllers/request_controller_spec.rb') diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 0d9916b71..64f3f8061 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -526,6 +526,8 @@ describe RequestController, "when classifying an information request" do response.should render_template('user/wrong_user') end + + describe 'when the request is old and unclassified' do before do @@ -714,6 +716,16 @@ describe RequestController, "when classifying an information request" do post_status('rejected') response.should redirect_to(:controller => 'help', :action => 'unhappy', :url_title => @dog_request.url_title) end + + describe "when using custom statuses from the theme" do + InfoRequest.send(:require, File.expand_path(File.join(File.dirname(__FILE__), '..', 'models', 'customstates'))) + + it "knows about extended states" do + Time.stub!(:now).and_return(Time.utc(2007, 11, 10, 00, 01)) + post_status('deadline_extended') + flash[:notice].should == 'Authority has requested extension of the deadline.' + end + end end describe 'when redirecting after a successful status update by the request owner' do -- cgit v1.2.3