2010-03-04 06:22:45 +00:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class TaskTest < ActiveSupport::TestCase
|
2010-03-05 06:48:00 +00:00
|
|
|
|
|
|
|
test "Assignee Fails User Doesn't exist" do
|
|
|
|
project = Factory.create(:project)
|
|
|
|
task = Factory.create(:task, :project => project)
|
|
|
|
|
|
|
|
task.assigned_id = 12000
|
|
|
|
task.save
|
|
|
|
|
|
|
|
assert !task.valid?
|
|
|
|
assert_equal "Assignee doesn't exist", task.errors.first.last
|
2010-03-04 06:22:45 +00:00
|
|
|
end
|
2010-03-05 06:48:00 +00:00
|
|
|
|
|
|
|
test "Owner Fails User Doesn't exist" do
|
|
|
|
project = Factory.create(:project)
|
|
|
|
task = Factory.create(:task, :project => project)
|
|
|
|
|
|
|
|
task.owner_id = 12000
|
|
|
|
task.save
|
|
|
|
|
|
|
|
assert !task.valid?
|
|
|
|
assert_equal "Owner doesn't exist", task.errors.first.last
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2010-03-04 06:22:45 +00:00
|
|
|
end
|