diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 8 | ||||
-rw-r--r-- | spec/script/handle-mail-replies_spec.rb | 11 | ||||
-rw-r--r-- | spec/script/mailin_spec.rb | 4 |
3 files changed, 16 insertions, 7 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 128a42556..ae8d4f256 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -102,6 +102,14 @@ describe GeneralController, "when showing the frontpage" do end end + it 'should generate a feed URL for successful requests' do + get :frontpage + assigns[:feed_autodetect].size.should == 1 + successful_request_feed = assigns[:feed_autodetect].first + successful_request_feed[:title].should == 'Successful requests' + end + + it "should render the front page with default language and ignore the browser setting" do config = MySociety::Config.load_default() config['USE_DEFAULT_BROWSER_LANGUAGE'] = false diff --git a/spec/script/handle-mail-replies_spec.rb b/spec/script/handle-mail-replies_spec.rb index 90a8de27c..62d5c1dab 100644 --- a/spec/script/handle-mail-replies_spec.rb +++ b/spec/script/handle-mail-replies_spec.rb @@ -3,9 +3,9 @@ require "external_command" def mail_reply_test(email_filename) Dir.chdir Rails.root do - xc = ExternalCommand.new("script/handle-mail-replies", "--test") - xc.run(load_file_fixture(email_filename)) - + xc = ExternalCommand.new("script/handle-mail-replies", "--test", + :stdin_string => load_file_fixture(email_filename)) + xc.run xc.err.should == "" return xc end @@ -13,8 +13,9 @@ end describe "When filtering" do it "should not fail when not in test mode" do - xc = ExternalCommand.new("script/handle-mail-replies") - xc.run(load_file_fixture("track-response-exim-bounce.email")) + xc = ExternalCommand.new("script/handle-mail-replies", + { :stdin_string => load_file_fixture("track-response-exim-bounce.email") }) + xc.run xc.err.should == "" end diff --git a/spec/script/mailin_spec.rb b/spec/script/mailin_spec.rb index 46ad39f7f..0ff094c2b 100644 --- a/spec/script/mailin_spec.rb +++ b/spec/script/mailin_spec.rb @@ -3,12 +3,12 @@ require "external_command" def mailin_test(email_filename) Dir.chdir Rails.root do - xc = ExternalCommand.new("script/mailin") + mail = load_file_fixture(email_filename) ir = info_requests(:other_request) mail.gsub!('EMAIL_TO', ir.incoming_email) mail.gsub!('EMAIL_FROM', 'responder@localhost') - xc.run(mail) + xc = ExternalCommand.new("script/mailin", :stdin_string => mail).run xc.err.should == "" return xc end |