mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
32 lines
753 B
Ruby
32 lines
753 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe WopiApp, type: :model do
|
|
let(:wopi_app) { build :wopi_app }
|
|
|
|
it 'is valid' do
|
|
expect(wopi_app).to be_valid
|
|
end
|
|
|
|
it 'should be of class WopiApp' do
|
|
expect(subject.class).to eq WopiApp
|
|
end
|
|
|
|
describe 'Database table' do
|
|
it { should have_db_column :name }
|
|
it { should have_db_column :icon }
|
|
it { should have_db_column :wopi_discovery_id }
|
|
end
|
|
|
|
describe 'Relations' do
|
|
it { should belong_to :wopi_discovery }
|
|
it { should have_many :wopi_actions }
|
|
end
|
|
|
|
describe 'Should be a valid object' do
|
|
it { should validate_presence_of :name }
|
|
it { should validate_presence_of :icon }
|
|
it { should validate_presence_of :wopi_discovery }
|
|
end
|
|
end
|