2019-05-09 23:10:02 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-30 00:49:07 +08:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe WopiApp, type: :model do
|
2019-05-09 23:10:02 +08:00
|
|
|
let(:wopi_app) { build :wopi_app }
|
|
|
|
|
|
|
|
it 'is valid' do
|
|
|
|
expect(wopi_app).to be_valid
|
|
|
|
end
|
|
|
|
|
2017-08-30 00:49:07 +08:00
|
|
|
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
|