aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin_request_controller_spec.rb5
-rw-r--r--spec/controllers/general_controller_spec.rb14
-rw-r--r--spec/controllers/request_controller_spec.rb2
3 files changed, 13 insertions, 8 deletions
diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb
index 252818452..8a3934685 100644
--- a/spec/controllers/admin_request_controller_spec.rb
+++ b/spec/controllers/admin_request_controller_spec.rb
@@ -21,6 +21,11 @@ describe AdminRequestController, "when administering requests" do
get :show, :id => info_requests(:fancy_dog_request)
end
+ it 'shows an external public body with no username' do
+ get :show, :id => info_requests(:anonymous_external_request)
+ response.should be_success
+ end
+
it "edits a public body" do
get :edit, :id => info_requests(:fancy_dog_request)
end
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index df2c139bd..de8dd8422 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -9,7 +9,7 @@ describe GeneralController, "when trying to show the blog" do
FakeWeb.clean_registry
end
- it "should fail silently if the blog is returning an error" do
+ it "should fail silently if the blog is returning an error" do
FakeWeb.register_uri(:get, %r|.*|, :body => "Error", :status => ["500", "Error"])
get :blog
response.status.should == "200 OK"
@@ -76,7 +76,7 @@ describe GeneralController, "when searching" do
response.should redirect_to(:action => 'search', :combined => "mouse", :view => "all") # URL /search/:query/all
end
- describe "when using different locale settings" do
+ describe "when using different locale settings" do
home_link_regex = /href=".*\/en\//
it "should generate URLs with a locale prepended when there's more than one locale set" do
get :frontpage
@@ -117,7 +117,7 @@ describe GeneralController, "when searching" do
I18n.available_locales = old_i18n_available_locales
end
end
-
+
describe 'when constructing the list of recent requests' do
before(:each) do
load_raw_emails_data
@@ -127,7 +127,7 @@ describe GeneralController, "when searching" do
it 'should list the newest successful request first' do
# Make sure the newest is listed first even if an older one
# has a newer comment or was reclassified more recently:
- # https://github.com/sebbacon/alaveteli/issues/370
+ # https://github.com/mysociety/alaveteli/issues/370
#
# This is a deliberate behaviour change, in that the
# previous behaviour (showing more-recently-reclassified
@@ -135,7 +135,7 @@ describe GeneralController, "when searching" do
get :frontpage
assigns[:request_events].first.info_request.should == info_requests(:another_boring_request)
end
-
+
it 'should coalesce duplicate requests' do
get :frontpage
assigns[:request_events].map(&:info_request).select{|x|x.url_title =~ /^spam/}.length.should == 1
@@ -231,7 +231,7 @@ describe GeneralController, "when searching" do
u.email_confirmed = true
u.save!
update_xapian_index
-
+
get :search, :combined => ["unconfirmed", "users"]
response.should render_template('search')
assigns[:xapian_users].results.map{|x|x[:model]}.should == [u]
@@ -239,7 +239,7 @@ describe GeneralController, "when searching" do
it "should show tracking links for requests-only searches" do
get :search, :combined => ['"bob"', "requests"]
- response.body.should include('Track this search')
+ response.body.should include('Track this search')
end
end
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 0ff795029..b8425613c 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -522,7 +522,7 @@ describe RequestController, "when showing one request" do
# error-handling path, causing the wrong sort of error response to be returned in the
# case where the integer prefix referred to the wrong request.)
#
- # https://github.com/sebbacon/alaveteli/issues/351
+ # https://github.com/mysociety/alaveteli/issues/351
it "should return 404 for ugly URLs containing a request id that isn't an integer" do
ir = info_requests(:fancy_dog_request)
receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email)