diff options
-rw-r--r-- | app/controllers/user_controller.rb | 6 | ||||
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 26 | ||||
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 25 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 2 | ||||
-rw-r--r-- | todo.txt | 3 | ||||
-rw-r--r-- | vendor/plugins/acts_as_solr/config/environment.rb | 4 |
6 files changed, 35 insertions, 31 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 5789fb78b..edde31749 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.34 2008-02-28 16:55:59 francis Exp $ +# $Id: user_controller.rb,v 1.35 2008-03-06 14:15:41 francis Exp $ class UserController < ApplicationController # Show page about a set of users with same url name @@ -96,7 +96,7 @@ class UserController < ApplicationController if params[:r] redirect_to params[:r] else - redirect_to :controller => "request", :action => "frontpage" + redirect_to :controller => "general", :action => "frontpage" end end @@ -156,7 +156,7 @@ class UserController < ApplicationController post_redirect = PostRedirect.find_by_token(params[:pretoken]) do_post_redirect post_redirect.uri, post_redirect.post_params else - redirect_to :controller => "request", :action => "frontpage" # XXX should go back to login and where they were! + redirect_to :controller => "general", :action => "frontpage" # XXX should go back to login and where they were! end end else diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb new file mode 100644 index 000000000..ab2a0eb60 --- /dev/null +++ b/spec/controllers/general_controller_spec.rb @@ -0,0 +1,26 @@ +require File.dirname(__FILE__) + '/../spec_helper' + +describe GeneralController, "when showing the front page" do + integrate_views + fixtures :users + + it "should be successful" do + get :frontpage + response.should be_success + end + + it "should have sign in/up link when not signed in" do + get :frontpage + response.should have_tag('a', "Sign in or sign up") + end + + it "should have sign out link when signed in" do + session[:user_id] = users(:bob_smith_user).id + get :frontpage + response.should have_tag('a', "Sign out") + end + + +end + + diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 4d68c2b8c..d8a0466ba 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1,28 +1,5 @@ require File.dirname(__FILE__) + '/../spec_helper' -describe RequestController, "when showing the front page" do - integrate_views - fixtures :users - - it "should be successful" do - get :frontpage - response.should be_success - end - - it "should have sign in/up link when not signed in" do - get :frontpage - response.should have_tag('a', "Sign in or sign up") - end - - it "should have sign out link when signed in" do - session[:user_id] = users(:bob_smith_user).id - get :frontpage - response.should have_tag('a', "Sign out") - end - - -end - describe RequestController, "when listing all requests" do integrate_views fixtures :info_requests, :outgoing_messages @@ -91,7 +68,7 @@ describe RequestController, "when creating a new request" do it "should redirect to front page if no public body specified" do get :new - response.should redirect_to(:action => 'frontpage') + response.should redirect_to(:controller => 'general', :action => 'frontpage') end it "should accept a public body parameter posted from the front page" do diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index cf82ccfb7..66f883ef3 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -153,7 +153,7 @@ describe UserController, "when signing out" do session[:user_id] = users(:bob_smith_user).id get :signout session[:user_id].should be_nil - response.should redirect_to(:controller => 'request', :action => 'frontpage') + response.should redirect_to(:controller => 'general', :action => 'frontpage') end it "should log you out and redirect you to where you were" do @@ -1,7 +1,6 @@ Search: -Deploy solr - do something with config file and access to ports -Security +Security of port access Go to correct id for incoming / outgoing messages Show correct extract for incoming / outgoing messages diff --git a/vendor/plugins/acts_as_solr/config/environment.rb b/vendor/plugins/acts_as_solr/config/environment.rb index 3450bfe83..851b59788 100644 --- a/vendor/plugins/acts_as_solr/config/environment.rb +++ b/vendor/plugins/acts_as_solr/config/environment.rb @@ -4,7 +4,9 @@ SOLR_PATH = "#{File.dirname(File.expand_path(__FILE__))}/../solr" unless defined # XXX hacky stuff to read the port from the main config file RAILS_SOLR_CONFIG="#{SOLR_PATH}/../../../../config/solr.yml" rails_solr_config = YAML.load(File.read(RAILS_SOLR_CONFIG)) -rails_solr_url = rails_solr_config[ENV['RAILS_ENV']]['url'] +rails_solr_config_read = rails_solr_config[ENV['RAILS_ENV']] +raise "no config in solr.yml for " + ENV['RAILS_ENV'] if rails_solr_config_read.nil? +rails_solr_url = rails_solr_config_read['url'] rails_solr_port = rails_solr_url.match(/http:\/\/localhost:(\d+)\/solr/)[1] SOLR_PORT = rails_solr_port.to_i |