diff options
-rw-r--r-- | app/models/public_body.rb | 2 | ||||
-rw-r--r-- | app/views/public_body/show.rhtml | 4 | ||||
-rw-r--r-- | config/environment.rb | 3 | ||||
-rw-r--r-- | config/routes.rb | 1 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 5 | ||||
-rw-r--r-- | spec/models/outgoing_mailer_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/xapian_spec.rb | 1 | ||||
-rw-r--r-- | spec/spec_helper.rb | 10 |
8 files changed, 14 insertions, 14 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 3071a38c5..51d6ea914 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -177,7 +177,7 @@ class PublicBody < ActiveRecord::Base end def name=(name) globalize.write(self.class.locale || I18n.locale, :name, name) - self[:name] = short_name + self[:name] = name globalize.save_translations! self.update_url_name end diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index f93518b7a..8b56d68c0 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -78,7 +78,7 @@ <% if @public_body.eir_only? %> <%=pluralize(@public_body.info_requests.size, "Environmental Information Regulations request") %> made using this site <% else %> - <%= n_('Freedom of Information request', 'Freedom if Information requests', @public_body.info_requests.size) %> made using this site + <%= n_('%d Freedom of Information request', '%d Freedom of Information requests', @public_body.info_requests.size) % @public_body.info_requests.size %> made using this site <% end %> <%= @page_desc %> </h2> @@ -89,7 +89,7 @@ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %> - <p> <%= _('Only requests made using {{site_name}} are shown.', site_name => @site_name) %></p> + <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p> <% end %> <% else %> diff --git a/config/environment.rb b/config/environment.rb index 7a6c5433f..a3c93db53 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -34,9 +34,6 @@ Rails::Initializer.run do |config| MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true) MySociety::Config.load_default - # fallback locale - I18n.default_locale = :en - # Settings in config/environments/* take precedence over those specified here # Skip frameworks you're not going to use (only works if using vendor/rails) diff --git a/config/routes.rb b/config/routes.rb index 008f9bfe4..2bf8e87fb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -147,6 +147,7 @@ ActionController::Routing::Routes.draw do |map| map.with_options :controller => 'admin_request' do |admin| admin.admin_request_list_old_unclassified '/admin/unclassified', :action => 'list_old_unclassified' + admin.admin_request_index '/admin/request', :action => 'index' admin.admin_request_list '/admin/request/list', :action => 'list' admin.admin_request_show '/admin/request/show/:id', :action => 'show' admin.admin_request_resend '/admin/request/resend', :action => 'resend' diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 90f90860a..81da94e67 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -125,7 +125,7 @@ describe UserController, "when signing in" do # check is right confirmation URL mail_token.should == post_redirect.email_token - params_from(:get, mail_path).should == { :controller => 'user', :action => 'confirm', :email_token => mail_token } + params_from(:get, mail_path).should == { :controller => 'user', :action => 'confirm', :email_token => mail_token, :locale => "en" } # check confirmation URL works session[:user_id].should be_nil @@ -421,7 +421,8 @@ describe UserController, "when changing email address" do "old_email"=>"bob@localhost", "new_email"=>"newbob@localhost", "password"=>"jonespassword"}, - "controller"=>"user"} + "controller"=>"user", + "locale"=>"en"} post :signchangeemail, post_redirect.post_params response.should redirect_to(:controller => 'user', :action => 'show', :url_name => 'bob_smith') diff --git a/spec/models/outgoing_mailer_spec.rb b/spec/models/outgoing_mailer_spec.rb index e86f5635c..71a46f8f8 100644 --- a/spec/models/outgoing_mailer_spec.rb +++ b/spec/models/outgoing_mailer_spec.rb @@ -24,7 +24,7 @@ describe OutgoingMailer, " when working out follow up addresses" do # check the basic entry in the fixture is fine OutgoingMailer.name_and_email_for_followup(ir, im).should == "foiperson@localhost" - OutgoingMailer.name_for_followup(ir, im).should == "The Geraldine Quango" + OutgoingMailer.name_for_followup(ir, im).should == "Geraldine Quango" OutgoingMailer.email_for_followup(ir, im).should == "foiperson@localhost" end diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb index 36836d95b..00a88be99 100644 --- a/spec/models/xapian_spec.rb +++ b/spec/models/xapian_spec.rb @@ -302,7 +302,6 @@ describe PublicBody, " when indexing authorities by tag" do xapian_object = InfoRequest.full_search([PublicBody], "tag:mice", 'created_at', true, nil, 100, 1) xapian_object.results.size.should == 1 xapian_object.results[0][:model] == public_bodies(:geraldine_public_body) - xapian_object = InfoRequest.full_search([PublicBody], "tag:mice:3", 'created_at', true, nil, 100, 1) xapian_object.results.size.should == 1 xapian_object.results[0][:model] == public_bodies(:geraldine_public_body) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c6e894584..f0f50d61e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] ||= 'test' -RAILS_ENV = "test" require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment')) require 'spec/autorun' require 'spec/rails' @@ -17,8 +16,6 @@ Spec::Runner.configure do |config| # If you're not using ActiveRecord you should remove these # lines, delete config/database.yml and disable :active_record # in your config/boot.rb - config.use_transactional_fixtures = true - config.use_instantiated_fixtures = false config.fixture_path = RAILS_ROOT + '/spec/fixtures/' # == Fixtures @@ -118,6 +115,11 @@ if $tempfilecount.nil? def process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET') # Call original process function + if parameters.nil? + parameters = {:locale => "en"} + elsif not parameters.has_key?(:locale) + parameters[:locale] = "en" + end self.original_process(action, parameters, session, flash, http_method) # XXX Is there a better way to check this than calling a private method? @@ -133,4 +135,4 @@ if $tempfilecount.nil? else puts "WARNING: HTML validation script " + $html_validation_script + " not found" end -end
\ No newline at end of file +end |