mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
29 lines
764 B
Ruby
29 lines
764 B
Ruby
require 'test_helper'
|
|
|
|
# Tests for the Session model class
|
|
class SessionTest < ActiveSupport::TestCase
|
|
test 'session not valid without a username' do
|
|
session = sessions(:tolkien)
|
|
session.username = nil
|
|
|
|
refute session.valid?,
|
|
'Session username is not being validated for presence'
|
|
end
|
|
|
|
test 'session not valid without a password' do
|
|
session = sessions(:tolkien)
|
|
session.password = nil
|
|
|
|
refute session.valid?,
|
|
'Session password is not being validated for presence'
|
|
end
|
|
|
|
test 'session fixture assumptions' do
|
|
assert_not_nil sessions(:tolkien),
|
|
'Sessions fixture is not available'
|
|
|
|
assert sessions(:tolkien).valid?,
|
|
'Sessions fixture :one is not a valid session'
|
|
end
|
|
end
|