mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-30 20:23:14 +08:00
22 lines
502 B
Ruby
22 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
|