* feat: add per-inbox signature management - Introduced `InboxSignature` model to manage signatures specific to each inbox. - Added API endpoints for fetching, creating, updating, and deleting inbox signatures. - Updated UI components to support inbox-specific signatures, including overrides for signature position and separator. - Implemented a new composable `useInboxSignatures` for managing inbox signatures in the frontend. - Enhanced existing components to utilize inbox signatures, including the reply box and message signature settings. - Added tests for the new inbox signatures functionality, ensuring proper behavior of the API and model validations. - Updated translations for new UI elements related to inbox signatures. * feat: implement inbox access validation and add related tests * feat: enhance inbox signatures fetching and management logic
24 lines
795 B
Ruby
24 lines
795 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe InboxSignature do
|
|
describe 'associations' do
|
|
it { is_expected.to belong_to(:user) }
|
|
it { is_expected.to belong_to(:inbox) }
|
|
end
|
|
|
|
describe 'validations' do
|
|
subject { create(:inbox_signature, user: user, inbox: inbox) }
|
|
|
|
let(:account) { create(:account) }
|
|
let(:user) { create(:user, account: account) }
|
|
let(:inbox) { create(:inbox, account: account) }
|
|
|
|
it { is_expected.to validate_presence_of(:message_signature) }
|
|
it { is_expected.to validate_uniqueness_of(:user_id).scoped_to(:inbox_id) }
|
|
it { is_expected.to validate_inclusion_of(:signature_position).in_array(%w[top bottom]) }
|
|
it { is_expected.to validate_inclusion_of(:signature_separator).in_array(%w[blank --]) }
|
|
end
|
|
end
|