Feature: Webhooks (#489)

This commit is contained in:
Subin T P
2020-02-14 23:19:17 +05:30
committed by GitHub
parent 79a847aeab
commit 919261d843
29 changed files with 566 additions and 214 deletions

View File

@@ -14,4 +14,5 @@ RSpec.describe Account do
it { is_expected.to have_many(:facebook_pages).class_name('::Channel::FacebookPage').dependent(:destroy) }
it { is_expected.to have_many(:web_widgets).class_name('::Channel::WebWidget').dependent(:destroy) }
it { is_expected.to have_one(:subscription).dependent(:destroy) }
it { is_expected.to have_many(:webhooks).dependent(:destroy) }
end

View File

@@ -23,6 +23,7 @@ RSpec.describe Inbox do
it { is_expected.to have_many(:conversations).dependent(:destroy) }
it { is_expected.to have_many(:messages).through(:conversations) }
it { is_expected.to have_one(:webhook) }
end
describe '#add_member' do

View File

@@ -0,0 +1,13 @@
require 'rails_helper'
RSpec.describe Webhook, type: :model do
describe 'validations' do
it { is_expected.to validate_presence_of(:account_id) }
it { is_expected.to validate_presence_of(:inbox_id) }
end
describe 'associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:inbox) }
end
end