feat: Team APIs (#1654)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) }
|
||||
|
||||
|
||||
8
spec/models/team_member_spec.rb
Normal file
8
spec/models/team_member_spec.rb
Normal 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
9
spec/models/team_spec.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user