feat: Add APIs for Campaigns (#2175)

This commit is contained in:
Sojan Jose
2021-04-29 22:23:32 +05:30
committed by GitHub
parent 3afc9b5f5b
commit b89cc9cf57
23 changed files with 452 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Campaign, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:inbox) }
end
describe '.before_create' do
let(:campaign) { build(:campaign, display_id: nil) }
before do
campaign.save
campaign.reload
end
it 'runs before_create callbacks' do
expect(campaign.display_id).to eq(1)
end
end
end

View File

@@ -7,6 +7,7 @@ require Rails.root.join 'spec/models/concerns/round_robin_handler_spec.rb'
RSpec.describe Conversation, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:inbox) }
end
describe 'concerns' do