Commit 00b6eed08df47e0afd1e7e0b3ecfcd2ae5a019b0

Authored by Joenio Costa
1 parent 51e4c391

Do not interpolate variable into error message from Article validation

- Adding draft of how to install deps to Rails 2.3.5 in HACKING.rails235
  file
- All units tests should inherits from ActiveSupport::TestCase
HACKING.rails235 0 → 100644
... ... @@ -0,0 +1,14 @@
  1 +This is a draft of how to create a environment to Rails 2.3.5 to Noosfero
  2 +development.
  3 +
  4 +Install dependencies:
  5 +
  6 +gem install rails -v 2.3.5
  7 +gem install ferret
  8 +gem install i18n
  9 +gem install will_paginate
  10 +gem install cucumber
  11 +
  12 +Creating initial environment:
  13 +
  14 +rake db:schema:load
... ...
app/models/article.rb
... ... @@ -13,7 +13,7 @@ class Article < ActiveRecord::Base
13 13 validates_presence_of :profile_id, :name
14 14 validates_presence_of :slug, :path, :if => lambda { |article| !article.name.blank? }
15 15  
16   - validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('<!-- %{fn} -->The title (article name) is already being used by another article, please use another title.'), :if => lambda { |article| !article.slug.blank? }
  16 + validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('The title (article name) is already being used by another article, please use another title.'), :if => lambda { |article| !article.slug.blank? }
17 17  
18 18 belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id'
19 19  
... ...
test/unit/unit_test.rb
1 1 require File.dirname(__FILE__) + '/../test_helper'
2 2  
3   -class UnitTest < Test::Unit::TestCase
  3 +class UnitTest < ActiveSupport::TestCase
4 4  
5 5 should 'require singular name' do
6 6 unit = Unit.new; unit.valid?
... ...