aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-07-12 10:51:30 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-07-12 10:51:30 +0100
commit438367a13ae31fb7ebcc30bf4a9e82ec7e9f78a7 (patch)
tree6515b918c55db3079a7c0ae3a17a9025a5602c80 /spec/controllers/request_controller_spec.rb
parent5132e9aa7e161aad91544340703e8e3ba6aea8f3 (diff)
Improve factoring out of custom states code (refactor a little, add tests)
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb12
1 files changed, 12 insertions, 0 deletions
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