diff options
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/admin_public_body_category_edit_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/admin_public_body_edit_spec.rb | 3 | ||||
-rw-r--r-- | spec/integration/admin_public_body_heading_edit_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/admin_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/alaveteli_dsl.rb | 1 | ||||
-rw-r--r-- | spec/integration/cookie_stripping_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/create_request_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/download_request_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/errors_spec.rb | 2 | ||||
-rw-r--r-- | spec/integration/ip_spoofing_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/localisation_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/parameter_stripping_spec.rb | 24 | ||||
-rw-r--r-- | spec/integration/request_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/integration/search_request_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/view_request_spec.rb | 1 | ||||
-rw-r--r-- | spec/integration/xapian_search_highlighting_spec.rb | 6 |
16 files changed, 46 insertions, 5 deletions
diff --git a/spec/integration/admin_public_body_category_edit_spec.rb b/spec/integration/admin_public_body_category_edit_spec.rb index 043524189..4e210de82 100644 --- a/spec/integration/admin_public_body_category_edit_spec.rb +++ b/spec/integration/admin_public_body_category_edit_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/admin_public_body_edit_spec.rb b/spec/integration/admin_public_body_edit_spec.rb index aeec3e65a..ed51f414b 100644 --- a/spec/integration/admin_public_body_edit_spec.rb +++ b/spec/integration/admin_public_body_edit_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') @@ -39,7 +40,7 @@ describe 'Editing a Public Body' do end end - it 'can add a translation for multiple locales', :focus => true do + it 'can add a translation for multiple locales' do @admin.visit edit_admin_body_path(@body) @admin.fill_in 'public_body_name__en', :with => 'New Quango EN' @admin.click_button 'Save' diff --git a/spec/integration/admin_public_body_heading_edit_spec.rb b/spec/integration/admin_public_body_heading_edit_spec.rb index 6c7a5a74b..f37d033f3 100644 --- a/spec/integration/admin_public_body_heading_edit_spec.rb +++ b/spec/integration/admin_public_body_heading_edit_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/admin_spec.rb b/spec/integration/admin_spec.rb index bdd6e9d8c..552b465bd 100644 --- a/spec/integration/admin_spec.rb +++ b/spec/integration/admin_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/alaveteli_dsl.rb b/spec/integration/alaveteli_dsl.rb index d7485a094..1ff60664c 100644 --- a/spec/integration/alaveteli_dsl.rb +++ b/spec/integration/alaveteli_dsl.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- module AlaveteliDsl def browses_request(url_title) diff --git a/spec/integration/cookie_stripping_spec.rb b/spec/integration/cookie_stripping_spec.rb index 897899fd5..e28e7b8e4 100644 --- a/spec/integration/cookie_stripping_spec.rb +++ b/spec/integration/cookie_stripping_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/create_request_spec.rb b/spec/integration/create_request_spec.rb index 84fad12f9..9b579c448 100644 --- a/spec/integration/create_request_spec.rb +++ b/spec/integration/create_request_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/download_request_spec.rb b/spec/integration/download_request_spec.rb index 48b42b11d..1050e6792 100644 --- a/spec/integration/download_request_spec.rb +++ b/spec/integration/download_request_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') @@ -143,7 +144,8 @@ describe 'when making a zipfile available' do it "should update the contents of the zipfile when the request changes" do - info_request = FactoryGirl.create(:info_request_with_incoming) + info_request = FactoryGirl.create(:info_request_with_incoming, + :title => 'Example Title') request_owner = login(info_request.user) inspect_zip_download(request_owner, info_request) do |zip| zip.count.should == 1 # just the message diff --git a/spec/integration/errors_spec.rb b/spec/integration/errors_spec.rb index 39f1279ce..64145cce0 100644 --- a/spec/integration/errors_spec.rb +++ b/spec/integration/errors_spec.rb @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe "When errors occur" do diff --git a/spec/integration/ip_spoofing_spec.rb b/spec/integration/ip_spoofing_spec.rb index 073f71ad6..ce11bcf0b 100644 --- a/spec/integration/ip_spoofing_spec.rb +++ b/spec/integration/ip_spoofing_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe 'when getting a country message' do diff --git a/spec/integration/localisation_spec.rb b/spec/integration/localisation_spec.rb index 037603ad5..f96cd4c3a 100644 --- a/spec/integration/localisation_spec.rb +++ b/spec/integration/localisation_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe "when generating urls" do diff --git a/spec/integration/parameter_stripping_spec.rb b/spec/integration/parameter_stripping_spec.rb new file mode 100644 index 000000000..7e3c0adc2 --- /dev/null +++ b/spec/integration/parameter_stripping_spec.rb @@ -0,0 +1,24 @@ +# -*- encoding : utf-8 -*- +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe "When handling bad requests" do + + if RUBY_VERSION == '1.9.3' + + it 'should return a 404 for GET requests to a malformed request URL' do + get 'request/228%85' + response.status.should == 404 + end + + it 'should redirect a bad UTF-8 POST to a malformed attachment URL' do + info_request = FactoryGirl.create(:info_request_with_incoming_attachments) + incoming_message = info_request.incoming_messages.first + data = { :excerpt => "something\xA3\xA1" } + post "/en/request/#{info_request.id}/response/#{incoming_message.id}/attach/2/interesting.pdf/trackback", data + response.status.should == 303 + response.should redirect_to "/en/request/#{info_request.url_title}#incoming-#{incoming_message.id}" + end + + end + +end diff --git a/spec/integration/request_controller_spec.rb b/spec/integration/request_controller_spec.rb index f5de692b8..1ef6814f9 100644 --- a/spec/integration/request_controller_spec.rb +++ b/spec/integration/request_controller_spec.rb @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/search_request_spec.rb b/spec/integration/search_request_spec.rb index 699eb2c6c..7a09c78fb 100644 --- a/spec/integration/search_request_spec.rb +++ b/spec/integration/search_request_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/view_request_spec.rb b/spec/integration/view_request_spec.rb index 4d04c97d7..ed84ec2e2 100644 --- a/spec/integration/view_request_spec.rb +++ b/spec/integration/view_request_spec.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl') diff --git a/spec/integration/xapian_search_highlighting_spec.rb b/spec/integration/xapian_search_highlighting_spec.rb index c0834a2c1..eea9893a8 100644 --- a/spec/integration/xapian_search_highlighting_spec.rb +++ b/spec/integration/xapian_search_highlighting_spec.rb @@ -1,10 +1,14 @@ -# encoding: utf-8 +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe 'highlighting search results' do include HighlightHelper + before do + get_fixtures_xapian_index + end + it 'ignores stopwords' do phrase = 'department of humpadinking' search = ActsAsXapian::Search.new([PublicBody], phrase, :limit => 1) |