mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-28 19:56:11 +01:00
fix failing tests
This commit is contained in:
parent
fd3f69d927
commit
6b36d6eb8f
8 changed files with 17 additions and 11 deletions
|
|
@ -50,7 +50,8 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def set_locale
|
||||
locale = params[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first
|
||||
locale = params[:locale]
|
||||
locale = locale || request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE']
|
||||
I18n.locale = I18n::available_locales.include?(locale) ? locale : I18n.default_locale
|
||||
logger.debug("Selected '#{I18n.locale}' as locale")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ class Project < ActiveRecord::Base
|
|||
|
||||
def self.feed_options(user)
|
||||
{
|
||||
:title => t('models.project.feed_title'),
|
||||
:description => t('models.project.feed_description', :username => user.display_name)
|
||||
:title => I18n.t('models.project.feed_title'),
|
||||
:description => I18n.t('models.project.feed_description', :username => user.display_name)
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class Todo < ActiveRecord::Base
|
|||
|
||||
def validate
|
||||
if !show_from.blank? && show_from < user.date
|
||||
errors.add("show_from", t('models.todo.error_date_must_be_future'))
|
||||
errors.add("show_from", I18n.t('models.todo.error_date_must_be_future'))
|
||||
end
|
||||
errors.add(:description, "may not contain \" characters") if /\"/.match(description)
|
||||
unless @predecessor_array.nil? # Only validate predecessors if they changed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue