Commit 00b6eed08df47e0afd1e7e0b3ecfcd2ae5a019b0
1 parent
51e4c391
Exists in
master
and in
22 other branches
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
Showing
3 changed files
with
16 additions
and
2 deletions
Show diff stats
@@ -0,0 +1,14 @@ | @@ -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,7 +13,7 @@ class Article < ActiveRecord::Base | ||
13 | validates_presence_of :profile_id, :name | 13 | validates_presence_of :profile_id, :name |
14 | validates_presence_of :slug, :path, :if => lambda { |article| !article.name.blank? } | 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 | belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id' | 18 | belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id' |
19 | 19 |
test/unit/unit_test.rb
1 | require File.dirname(__FILE__) + '/../test_helper' | 1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | 2 | ||
3 | -class UnitTest < Test::Unit::TestCase | 3 | +class UnitTest < ActiveSupport::TestCase |
4 | 4 | ||
5 | should 'require singular name' do | 5 | should 'require singular name' do |
6 | unit = Unit.new; unit.valid? | 6 | unit = Unit.new; unit.valid? |