Didn't handle case of no user found gracefully

This commit is contained in:
epall 2008-06-07 17:15:12 -07:00 committed by Eric Allen
parent 8783beb280
commit 920507441d
2 changed files with 10 additions and 0 deletions

View file

@ -48,4 +48,12 @@ class SMSGatewayTest < Test::Rails::TestCase
assert_equal(@user, message_todo.user)
assert_equal("This is the message body", message_todo.notes)
end
def test_no_user
todo_count = Todo.count
badmessage = File.read(File.join(RAILS_ROOT, 'test', 'fixtures', 'sample_sms.txt'))
badmessage.gsub!("5555555555", "notauser")
SMSGateway.receive(badmessage)
assert_equal(todo_count, Todo.count)
end
end