feat: Team APIs (#1654)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Sojan Jose
2021-01-17 23:56:56 +05:30
committed by GitHub
parent dd90e24d02
commit a0c33254e7
29 changed files with 523 additions and 2 deletions

View File

@@ -20,4 +20,5 @@ RSpec.describe Account do
it { is_expected.to have_many(:events) }
it { is_expected.to have_many(:kbase_portals).dependent(:destroy) }
it { is_expected.to have_many(:kbase_categories).dependent(:destroy) }
it { is_expected.to have_many(:teams).dependent(:destroy) }
end

View File

@@ -3,6 +3,10 @@
require 'rails_helper'
RSpec.describe Conversation, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:account) }
end
describe '.before_create' do
let(:conversation) { build(:conversation, display_id: nil) }

View File

@@ -0,0 +1,8 @@
require 'rails_helper'
RSpec.describe TeamMember, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:team) }
it { is_expected.to belong_to(:user) }
end
end

9
spec/models/team_spec.rb Normal file
View File

@@ -0,0 +1,9 @@
require 'rails_helper'
RSpec.describe Team, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to have_many(:conversations) }
it { is_expected.to have_many(:team_members) }
end
end

View File

@@ -19,6 +19,7 @@ RSpec.describe User do
it { is_expected.to have_many(:notification_settings).dependent(:destroy) }
it { is_expected.to have_many(:messages) }
it { is_expected.to have_many(:events) }
it { is_expected.to have_many(:teams) }
end
describe 'concerns' do