scinote-web/spec/models/wopi_discovery_spec.rb

36 lines
981 B
Ruby
Raw Normal View History

2019-05-09 23:10:02 +08:00
# frozen_string_literal: true
2017-08-30 00:49:07 +08:00
require 'rails_helper'
describe WopiDiscovery, type: :model do
2019-05-09 23:10:02 +08:00
let(:wopi_discovery) { build :wopi_discovery }
it 'is valid' do
expect(wopi_discovery).to be_valid
end
2017-08-30 00:49:07 +08:00
it 'should be of class WopiDiscovery' do
expect(subject.class).to eq WopiDiscovery
end
describe 'Database table' do
it { should have_db_column :expires }
it { should have_db_column :proof_key_mod }
it { should have_db_column :proof_key_exp }
it { should have_db_column :proof_key_old_mod }
it { should have_db_column :proof_key_old_exp }
end
describe 'Relations' do
it { should have_many :wopi_apps }
end
describe 'Should be a valid object' do
it { should validate_presence_of :expires }
it { should validate_presence_of :proof_key_mod }
it { should validate_presence_of :proof_key_exp }
it { should validate_presence_of :proof_key_old_mod }
it { should validate_presence_of :proof_key_old_exp }
end
end