Commit c40cfd39bbef682930a2d5627e36f7493e81aa74
Committed by
Daniela Feitosa
1 parent
0d4ff218
Exists in
master
and in
28 other branches
Fixing ActionTracker::Record.user validation
* Also creating a migration to remove the broken records. (ActionItem1785)
Showing
3 changed files
with
15 additions
and
2 deletions
Show diff stats
db/migrate/20110127174236_remove_action_tracker_record_with_nil_users.rb
0 → 100644
vendor/plugins/action_tracker/lib/action_tracker_model.rb
vendor/plugins/action_tracker/test/action_tracker_model_test.rb
... | ... | @@ -67,6 +67,11 @@ class ActionTrackerModelTest < ActiveSupport::TestCase |
67 | 67 | end |
68 | 68 | end |
69 | 69 | |
70 | + def test_user_exists_indeed | |
71 | + ta = ActionTracker::Record.new(:user_id => -1, :user_type => "SomeModel", :verb => :some_verb) | |
72 | + assert !ta.valid? | |
73 | + end | |
74 | + | |
70 | 75 | def test_verb_must_be_declared_previously |
71 | 76 | ActionTrackerConfig.verbs = { :some_verb => { :description => "Did something" } } |
72 | 77 | assert_raise ActiveRecord::RecordInvalid do | ... | ... |