mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 19:24:10 +08:00
23 lines
502 B
Ruby
23 lines
502 B
Ruby
|
require 'rails_helper'
|
||
|
|
||
|
describe Token, type: :model do
|
||
|
it 'should be of class Token' do
|
||
|
expect(subject.class).to eq Token
|
||
|
end
|
||
|
|
||
|
describe 'Database table' do
|
||
|
it { should have_db_column :token }
|
||
|
it { should have_db_column :ttl }
|
||
|
it { should have_db_column :user_id }
|
||
|
end
|
||
|
|
||
|
describe 'Relations' do
|
||
|
it { should belong_to :user }
|
||
|
end
|
||
|
|
||
|
describe 'Should be a valid object' do
|
||
|
it { should validate_presence_of :token }
|
||
|
it { should validate_presence_of :ttl }
|
||
|
end
|
||
|
end
|