Maintenance: Make S/MIME system spec more stable by applying temporary "Setting.set before authenticated" workaround.

This commit is contained in:
Mantas 2020-06-16 01:11:29 +03:00 committed by Thorsten Eckel
parent 0f5b102533
commit 05fb40a3f8
2 changed files with 10 additions and 8 deletions

View file

@ -22,14 +22,15 @@ RSpec.describe 'Ticket Create', type: :system do
include_examples 'text modules', path: 'ticket/create' include_examples 'text modules', path: 'ticket/create'
end end
context 'S/MIME' do context 'S/MIME', authenticated_as: :authenticate do
def authenticate
prepend_before do
Setting.set('smime_integration', true) Setting.set('smime_integration', true)
current_user
end end
context 'no certificate present' do context 'no certificate present' do
let!(:template) { create(:template, :dummy_data) } let!(:template) { create(:template, :dummy_data) }
let(:current_user) { true }
it 'has no security selections' do it 'has no security selections' do
visit 'ticket/create' visit 'ticket/create'
@ -55,7 +56,8 @@ RSpec.describe 'Ticket Create', type: :system do
end end
end end
context 'private key configured', authenticated_as: :agent do context 'private key configured' do
let(:current_user) { agent }
let!(:template) { create(:template, :dummy_data, group: group, owner: agent, customer: customer) } let!(:template) { create(:template, :dummy_data, group: group, owner: agent, customer: customer) }
let(:system_email_address) { 'smime1@example.com' } let(:system_email_address) { 'smime1@example.com' }

View file

@ -395,8 +395,7 @@ RSpec.describe 'Ticket zoom', type: :system do
end end
end end
context 'S/MIME active', authenticated_as: :agent do context 'S/MIME active', authenticated_as: :authenticate do
let(:system_email_address) { 'smime1@example.com' } let(:system_email_address) { 'smime1@example.com' }
let(:email_address) { create(:email_address, email: system_email_address) } let(:email_address) { create(:email_address, email: system_email_address) }
let(:group) { create(:group, email_address: email_address) } let(:group) { create(:group, email_address: email_address) }
@ -408,8 +407,9 @@ RSpec.describe 'Ticket zoom', type: :system do
let!(:ticket) { create(:ticket, group: group, owner: agent, customer: customer) } let!(:ticket) { create(:ticket, group: group, owner: agent, customer: customer) }
before do def authenticate
Setting.set('smime_integration', true) Setting.set('smime_integration', true)
agent
end end
context 'received mail' do context 'received mail' do