mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-02 02:50:16 +01:00
Didn't handle case of no user found gracefully
This commit is contained in:
parent
8783beb280
commit
920507441d
2 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue