2019-12-05 07:50:04 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
2020-09-29 19:42:32 +00:00
|
|
|
require Rails.root.join 'spec/models/concerns/reauthorizable_spec.rb'
|
2019-12-05 07:50:04 +00:00
|
|
|
|
|
|
|
RSpec.describe Channel::FacebookPage do
|
2020-09-04 13:43:47 +00:00
|
|
|
let(:channel) { create(:channel_facebook_page) }
|
2019-12-05 07:50:04 +00:00
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of(:account_id) }
|
2020-01-07 17:29:17 +00:00
|
|
|
# it { is_expected.to validate_uniqueness_of(:page_id).scoped_to(:account_id) }
|
2019-12-05 07:50:04 +00:00
|
|
|
it { is_expected.to belong_to(:account) }
|
|
|
|
it { is_expected.to have_one(:inbox).dependent(:destroy) }
|
2020-09-04 13:43:47 +00:00
|
|
|
|
2020-09-29 19:42:32 +00:00
|
|
|
describe 'concerns' do
|
|
|
|
it_behaves_like 'reauthorizable'
|
|
|
|
end
|
|
|
|
|
2020-09-04 13:43:47 +00:00
|
|
|
it 'has a valid name' do
|
|
|
|
expect(channel.name).to eq('Facebook')
|
|
|
|
end
|
2019-12-05 07:50:04 +00:00
|
|
|
end
|