2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2018-09-19 13:54:49 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2019-11-11 15:47:51 +00:00
|
|
|
RSpec.describe 'Ticket Article API endpoints', type: :request do
|
2018-09-19 13:54:49 +00:00
|
|
|
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:admin) do
|
|
|
|
create(:admin, groups: Group.all)
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|
2019-02-04 09:42:06 +00:00
|
|
|
let!(:group) { create(:group) }
|
2019-02-04 06:56:18 +00:00
|
|
|
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:agent) do
|
|
|
|
create(:agent, groups: Group.all)
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:customer) do
|
|
|
|
create(:customer)
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'request handling' do
|
|
|
|
|
|
|
|
it 'does ticket create with agent and articles' do
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'a new ticket #1',
|
|
|
|
group: 'Users',
|
2020-06-19 09:17:18 +00:00
|
|
|
customer_id: customer.id,
|
2018-12-19 17:31:51 +00:00
|
|
|
article: {
|
2018-09-19 13:54:49 +00:00
|
|
|
body: 'some body',
|
|
|
|
}
|
|
|
|
}
|
2020-06-19 09:17:18 +00:00
|
|
|
authenticated_as(agent)
|
2018-09-19 13:54:49 +00:00
|
|
|
post '/api/v1/tickets', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/plain', # or text/html
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body',
|
|
|
|
type: 'note',
|
2018-09-19 13:54:49 +00:00
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
|
|
|
expect(json_response['body']).to eq('some body')
|
|
|
|
expect(json_response['content_type']).to eq('text/plain')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(agent.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(agent.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
ticket = Ticket.find(json_response['ticket_id'])
|
|
|
|
expect(ticket.articles.count).to eq(2)
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['ticket_id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/html', # or text/html
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
|
2018-09-19 13:54:49 +00:00
|
|
|
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
|
|
|
|
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />',
|
2018-12-19 17:31:51 +00:00
|
|
|
type: 'note',
|
2018-09-19 13:54:49 +00:00
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
2021-05-12 11:37:44 +00:00
|
|
|
expect(json_response['body']).not_to match(%r{some body <img src="cid:.+?})
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response['body']).to match(%r{some body <img src="/api/v1/ticket_attachment/.+?" alt="Red dot"})
|
|
|
|
expect(json_response['content_type']).to eq('text/html')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(agent.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(agent.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
expect(ticket.articles.count).to eq(3)
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[2].attachments.count).to eq(1)
|
|
|
|
expect(ticket.articles[2].attachments[0]['id']).to be_truthy
|
|
|
|
expect(ticket.articles[2].attachments[0]['filename']).to eq('image1.png')
|
|
|
|
expect(ticket.articles[2].attachments[0]['size']).to eq('21')
|
|
|
|
expect(ticket.articles[2].attachments[0]['preferences']['Mime-Type']).to eq('image/png')
|
|
|
|
expect(ticket.articles[2].attachments[0]['preferences']['Content-Disposition']).to eq('inline')
|
2021-05-12 11:37:44 +00:00
|
|
|
expect(ticket.articles[2].attachments[0]['preferences']['Content-ID']).to match(%r{@zammad.example.com})
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['ticket_id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/html', # or text/html
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body',
|
|
|
|
type: 'note',
|
|
|
|
attachments: [
|
2020-07-13 12:46:08 +00:00
|
|
|
{ 'filename' => 'some_file.txt',
|
|
|
|
'data' => 'dGVzdCAxMjM=',
|
|
|
|
'mime-type' => 'text/plain' },
|
2018-09-19 13:54:49 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
|
|
|
expect(json_response['body']).to eq('some body')
|
|
|
|
expect(json_response['content_type']).to eq('text/html')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(agent.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(agent.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
expect(ticket.articles.count).to eq(4)
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[2].attachments.count).to eq(1)
|
|
|
|
expect(ticket.articles[3].attachments.count).to eq(1)
|
|
|
|
|
|
|
|
get "/api/v1/ticket_articles/#{json_response['id']}?expand=true", params: {}, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:ok)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['attachments'].count).to eq(1)
|
|
|
|
expect(json_response['attachments'][0]['id']).to be_truthy
|
|
|
|
expect(json_response['attachments'][0]['filename']).to eq('some_file.txt')
|
|
|
|
expect(json_response['attachments'][0]['size']).to eq('8')
|
|
|
|
expect(json_response['attachments'][0]['preferences']['Mime-Type']).to eq('text/plain')
|
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['ticket_id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/plain',
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body',
|
|
|
|
type: 'note',
|
2020-10-08 07:19:37 +00:00
|
|
|
internal: false,
|
2018-12-19 17:31:51 +00:00
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
some_key1: 123,
|
2020-10-08 07:19:37 +00:00
|
|
|
highlight: '123',
|
2018-09-19 13:54:49 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
|
|
|
expect(json_response['body']).to eq('some body')
|
2020-10-08 07:19:37 +00:00
|
|
|
expect(json_response['internal']).to eq(false)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response['content_type']).to eq('text/plain')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(agent.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(agent.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response['preferences']['some_key1']).to eq(123)
|
2020-10-08 07:19:37 +00:00
|
|
|
expect(json_response['preferences']['highlight']).to eq('123')
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(ticket.articles.count).to eq(5)
|
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body 2',
|
2020-10-08 07:19:37 +00:00
|
|
|
internal: true,
|
2018-09-19 13:54:49 +00:00
|
|
|
preferences: {
|
|
|
|
some_key2: 'abc',
|
2020-10-08 07:19:37 +00:00
|
|
|
highlight: '234',
|
2018-09-19 13:54:49 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
put "/api/v1/ticket_articles/#{json_response['id']}", params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:ok)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
2020-10-08 07:19:37 +00:00
|
|
|
expect(json_response['body']).not_to eq('some body 2')
|
|
|
|
expect(json_response['internal']).to eq(true)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response['content_type']).to eq('text/plain')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(agent.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(agent.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response['preferences']['some_key1']).to eq(123)
|
2020-10-08 07:19:37 +00:00
|
|
|
expect(json_response['preferences']['some_key2']).not_to eq('abc')
|
|
|
|
expect(json_response['preferences']['highlight']).to eq('234')
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does ticket create with customer and articles' do
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'a new ticket #2',
|
|
|
|
group: 'Users',
|
2018-09-19 13:54:49 +00:00
|
|
|
article: {
|
|
|
|
body: 'some body',
|
|
|
|
}
|
|
|
|
}
|
2020-06-19 09:17:18 +00:00
|
|
|
authenticated_as(customer)
|
2018-09-19 13:54:49 +00:00
|
|
|
post '/api/v1/tickets', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/plain', # or text/html
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body',
|
|
|
|
type: 'note',
|
2018-09-19 13:54:49 +00:00
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
|
|
|
expect(json_response['body']).to eq('some body')
|
|
|
|
expect(json_response['content_type']).to eq('text/plain')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(customer.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(customer.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
ticket = Ticket.find(json_response['ticket_id'])
|
|
|
|
expect(ticket.articles.count).to eq(2)
|
|
|
|
expect(ticket.articles[1].sender.name).to eq('Customer')
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['ticket_id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/plain', # or text/html
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body',
|
|
|
|
sender: 'Agent',
|
|
|
|
type: 'note',
|
2018-09-19 13:54:49 +00:00
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
|
|
|
expect(json_response['body']).to eq('some body')
|
|
|
|
expect(json_response['content_type']).to eq('text/plain')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(customer.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(customer.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
ticket = Ticket.find(json_response['ticket_id'])
|
|
|
|
expect(ticket.articles.count).to eq(3)
|
|
|
|
expect(ticket.articles[2].sender.name).to eq('Customer')
|
|
|
|
expect(ticket.articles[2].internal).to eq(false)
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[2].attachments.count).to eq(0)
|
|
|
|
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: json_response['ticket_id'],
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/plain', # or text/html
|
2018-12-19 17:31:51 +00:00
|
|
|
body: 'some body 2',
|
|
|
|
sender: 'Agent',
|
|
|
|
type: 'note',
|
|
|
|
internal: true,
|
2018-09-19 13:54:49 +00:00
|
|
|
}
|
|
|
|
post '/api/v1/ticket_articles', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['subject']).to be_nil
|
|
|
|
expect(json_response['body']).to eq('some body 2')
|
|
|
|
expect(json_response['content_type']).to eq('text/plain')
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(json_response['updated_by_id']).to eq(customer.id)
|
|
|
|
expect(json_response['created_by_id']).to eq(customer.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
|
|
|
|
ticket = Ticket.find(json_response['ticket_id'])
|
|
|
|
expect(ticket.articles.count).to eq(4)
|
|
|
|
expect(ticket.articles[3].sender.name).to eq('Customer')
|
|
|
|
expect(ticket.articles[3].internal).to eq(false)
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[2].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[3].attachments.count).to eq(0)
|
|
|
|
|
|
|
|
# add internal article
|
|
|
|
article = create(
|
|
|
|
:ticket_article,
|
|
|
|
ticket_id: ticket.id,
|
2018-12-19 17:31:51 +00:00
|
|
|
internal: true,
|
|
|
|
sender: Ticket::Article::Sender.find_by(name: 'Agent'),
|
|
|
|
type: Ticket::Article::Type.find_by(name: 'note'),
|
2018-09-19 13:54:49 +00:00
|
|
|
)
|
|
|
|
expect(ticket.articles.count).to eq(5)
|
|
|
|
expect(ticket.articles[4].sender.name).to eq('Agent')
|
|
|
|
expect(ticket.articles[4].updated_by_id).to eq(1)
|
|
|
|
expect(ticket.articles[4].created_by_id).to eq(1)
|
|
|
|
expect(ticket.articles[0].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[1].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[2].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[3].attachments.count).to eq(0)
|
|
|
|
expect(ticket.articles[4].attachments.count).to eq(0)
|
|
|
|
|
|
|
|
get "/api/v1/ticket_articles/#{article.id}", params: {}, as: :json
|
2021-02-04 08:28:41 +00:00
|
|
|
expect(response).to have_http_status(:forbidden)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['error']).to eq('Not authorized')
|
|
|
|
|
|
|
|
put "/api/v1/ticket_articles/#{article.id}", params: { internal: false }, as: :json
|
2021-02-04 08:28:41 +00:00
|
|
|
expect(response).to have_http_status(:forbidden)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['error']).to eq('Not authorized')
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does create phone ticket for customer and expected origin_by_id' do
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'a new ticket #1',
|
|
|
|
group: 'Users',
|
2020-06-19 09:17:18 +00:00
|
|
|
customer_id: customer.id,
|
2018-12-19 17:31:51 +00:00
|
|
|
article: {
|
|
|
|
body: 'some body',
|
2018-09-19 13:54:49 +00:00
|
|
|
sender: 'Customer',
|
2018-12-19 17:31:51 +00:00
|
|
|
type: 'phone',
|
2018-09-19 13:54:49 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-19 09:17:18 +00:00
|
|
|
authenticated_as(agent)
|
2018-09-19 13:54:49 +00:00
|
|
|
post '/api/v1/tickets', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['title']).to eq('a new ticket #1')
|
|
|
|
|
2019-02-04 16:43:56 +00:00
|
|
|
expect(Ticket::Article.where(ticket_id: json_response['id']).count).to eq(2) # original + auto responder
|
|
|
|
|
|
|
|
article = Ticket::Article.where(ticket_id: json_response['id']).first
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(article.origin_by_id).to eq(customer.id)
|
|
|
|
expect(article.from).to eq("#{customer.firstname} #{customer.lastname} <#{customer.email}>")
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'does create phone ticket by customer and manipulate origin_by_id' do
|
|
|
|
params = {
|
2018-12-19 17:31:51 +00:00
|
|
|
title: 'a new ticket #1',
|
|
|
|
group: 'Users',
|
2020-06-19 09:17:18 +00:00
|
|
|
customer_id: customer.id,
|
2018-12-19 17:31:51 +00:00
|
|
|
article: {
|
|
|
|
body: 'some body',
|
|
|
|
sender: 'Customer',
|
|
|
|
type: 'phone',
|
2018-09-19 13:54:49 +00:00
|
|
|
origin_by_id: 1,
|
|
|
|
}
|
|
|
|
}
|
2020-06-19 09:17:18 +00:00
|
|
|
authenticated_as(customer)
|
2018-09-19 13:54:49 +00:00
|
|
|
post '/api/v1/tickets', params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:created)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
|
2019-02-04 16:43:56 +00:00
|
|
|
expect(Ticket::Article.where(ticket_id: json_response['id']).count).to eq(1) # ony original
|
|
|
|
|
|
|
|
article = Ticket::Article.where(ticket_id: json_response['id']).first
|
2020-06-19 09:17:18 +00:00
|
|
|
expect(article.origin_by_id).to eq(customer.id)
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'does ticket split with html - check attachments' do
|
2019-02-04 06:56:18 +00:00
|
|
|
ticket = create(:ticket, group: group)
|
2018-09-19 13:54:49 +00:00
|
|
|
article = create(
|
|
|
|
:ticket_article,
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: ticket.id,
|
|
|
|
type: Ticket::Article::Type.lookup(name: 'note'),
|
|
|
|
sender: Ticket::Article::Sender.lookup(name: 'Customer'),
|
|
|
|
body: '<b>test</b> <img src="cid:15.274327094.140938@ZAMMAD.example.com"/> test <img src="cid:15.274327094.140938.3@ZAMMAD.example.com"/>',
|
2018-09-19 13:54:49 +00:00
|
|
|
content_type: 'text/html',
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file1_normally_should_be_an_image',
|
|
|
|
filename: 'some_file1.jpg',
|
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
'Mime-Type' => 'image/jpeg',
|
|
|
|
'Content-ID' => '15.274327094.140938@zammad.example.com',
|
|
|
|
'Content-Disposition' => 'inline',
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file2_normally_should_be_an_image',
|
|
|
|
filename: 'some_file2.jpg',
|
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
'Mime-Type' => 'image/jpeg',
|
|
|
|
'Content-ID' => '15.274327094.140938.2@zammad.example.com',
|
|
|
|
'Content-Disposition' => 'inline',
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file3_normally_should_be_an_image',
|
|
|
|
filename: 'some_file3.jpg',
|
|
|
|
preferences: {
|
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
'Mime-Type' => 'image/jpeg',
|
|
|
|
'Content-ID' => '15.274327094.140938.3@zammad.example.com',
|
2018-09-19 13:54:49 +00:00
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file4_normally_should_be_an_image',
|
|
|
|
filename: 'some_file4.jpg',
|
|
|
|
preferences: {
|
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
'Mime-Type' => 'image/jpeg',
|
|
|
|
'Content-ID' => '15.274327094.140938.4@zammad.example.com',
|
2018-09-19 13:54:49 +00:00
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file1_normally_should_be_an_pdf',
|
|
|
|
filename: 'Rechnung_RE-2018-200.pdf',
|
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
'Content-Type' => 'application/octet-stream; name="Rechnung_RE-2018-200.pdf"',
|
|
|
|
'Mime-Type' => 'application/octet-stream',
|
|
|
|
'Content-ID' => '8AB0BEC88984EE4EBEF643C79C8E0346@zammad.example.com',
|
|
|
|
'Content-Description' => 'Rechnung_RE-2018-200.pdf',
|
|
|
|
'Content-Disposition' => 'attachment',
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
|
|
|
|
params = {
|
|
|
|
form_id: 'new_form_id123',
|
|
|
|
}
|
2020-06-19 09:17:18 +00:00
|
|
|
authenticated_as(agent)
|
2018-09-19 13:54:49 +00:00
|
|
|
post "/api/v1/ticket_attachment_upload_clone_by_article/#{article.id}", params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:ok)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['attachments']).to be_truthy
|
|
|
|
expect(json_response['attachments'].count).to eq(3)
|
|
|
|
|
|
|
|
post "/api/v1/ticket_attachment_upload_clone_by_article/#{article.id}", params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:ok)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['attachments']).to be_truthy
|
|
|
|
expect(json_response['attachments'].count).to eq(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does ticket split with plain - check attachments' do
|
|
|
|
ticket = create(
|
|
|
|
:ticket,
|
2019-02-04 06:56:18 +00:00
|
|
|
group: group,
|
2020-06-19 09:17:18 +00:00
|
|
|
updated_by_id: agent.id,
|
|
|
|
created_by_id: agent.id,
|
2018-09-19 13:54:49 +00:00
|
|
|
)
|
|
|
|
article = create(
|
|
|
|
:ticket_article,
|
2018-12-19 17:31:51 +00:00
|
|
|
ticket_id: ticket.id,
|
|
|
|
type: Ticket::Article::Type.lookup(name: 'note'),
|
|
|
|
sender: Ticket::Article::Sender.lookup(name: 'Customer'),
|
|
|
|
body: '<b>test</b> <img src="cid:15.274327094.140938@zammad.example.com"/>',
|
|
|
|
content_type: 'text/plain',
|
2018-09-19 13:54:49 +00:00
|
|
|
updated_by_id: 1,
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file1_normally_should_be_an_image',
|
|
|
|
filename: 'some_file1.jpg',
|
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
'Mime-Type' => 'image/jpeg',
|
|
|
|
'Content-ID' => '15.274327094.140938@zammad.example.com',
|
|
|
|
'Content-Disposition' => 'inline',
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file1_normally_should_be_an_image',
|
|
|
|
filename: 'some_file2.jpg',
|
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
'Content-Type' => 'image/jpeg',
|
|
|
|
'Mime-Type' => 'image/jpeg',
|
|
|
|
'Content-ID' => '15.274327094.140938.2@zammad.example.com',
|
|
|
|
'Content-Disposition' => 'inline',
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
Store.add(
|
2018-12-19 17:31:51 +00:00
|
|
|
object: 'Ticket::Article',
|
|
|
|
o_id: article.id,
|
|
|
|
data: 'content_file1_normally_should_be_an_pdf',
|
|
|
|
filename: 'Rechnung_RE-2018-200.pdf',
|
|
|
|
preferences: {
|
2018-09-19 13:54:49 +00:00
|
|
|
'Content-Type' => 'application/octet-stream; name="Rechnung_RE-2018-200.pdf"',
|
|
|
|
'Mime-Type' => 'application/octet-stream',
|
|
|
|
'Content-ID' => '8AB0BEC88984EE4EBEF643C79C8E0346@zammad.example.com',
|
|
|
|
'Content-Description' => 'Rechnung_RE-2018-200.pdf',
|
|
|
|
'Content-Disposition' => 'attachment',
|
|
|
|
},
|
|
|
|
created_by_id: 1,
|
|
|
|
)
|
|
|
|
|
|
|
|
params = {
|
|
|
|
form_id: 'new_form_id123',
|
|
|
|
}
|
2020-06-19 09:17:18 +00:00
|
|
|
authenticated_as(agent)
|
2018-09-19 13:54:49 +00:00
|
|
|
post "/api/v1/ticket_attachment_upload_clone_by_article/#{article.id}", params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:ok)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['attachments']).to be_truthy
|
|
|
|
expect(json_response['attachments'].count).to eq(3)
|
|
|
|
|
|
|
|
post "/api/v1/ticket_attachment_upload_clone_by_article/#{article.id}", params: params, as: :json
|
2019-04-15 01:41:17 +00:00
|
|
|
expect(response).to have_http_status(:ok)
|
2018-09-19 13:54:49 +00:00
|
|
|
expect(json_response).to be_a_kind_of(Hash)
|
|
|
|
expect(json_response['attachments']).to be_truthy
|
|
|
|
expect(json_response['attachments'].count).to eq(0)
|
|
|
|
end
|
2021-03-16 08:59:32 +00:00
|
|
|
|
|
|
|
it 'does ticket create with mentions' do
|
|
|
|
params = {
|
|
|
|
title: 'a new ticket #1',
|
|
|
|
group: 'Users',
|
|
|
|
customer_id: customer.id,
|
|
|
|
article: {
|
|
|
|
body: "some body <a data-mention-user-id=\"#{agent.id}\">agent</a>",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
authenticated_as(agent)
|
|
|
|
post '/api/v1/tickets', params: params, as: :json
|
|
|
|
expect(response).to have_http_status(:created)
|
|
|
|
expect(Mention.where(mentionable: Ticket.last).count).to eq(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not ticket create with mentions when customer' do
|
|
|
|
params = {
|
|
|
|
title: 'a new ticket #1',
|
|
|
|
group: 'Users',
|
|
|
|
customer_id: customer.id,
|
|
|
|
article: {
|
|
|
|
body: "some body <a data-mention-user-id=\"#{agent.id}\">agent</a>",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
authenticated_as(customer)
|
|
|
|
post '/api/v1/tickets', params: params, as: :json
|
|
|
|
expect(response).to have_http_status(:internal_server_error)
|
|
|
|
expect(Mention.count).to eq(0)
|
|
|
|
end
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
describe 'DELETE /api/v1/ticket_articles/:id', authenticated_as: -> { user } do
|
2020-07-13 09:14:15 +00:00
|
|
|
let(:other_agent) { create(:agent, groups: [Group.first]) }
|
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
let(:ticket) do
|
2020-04-13 20:26:09 +00:00
|
|
|
create(:ticket, group: Group.first)
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
let(:article_communication) do
|
|
|
|
create(:ticket_article,
|
|
|
|
sender_name: 'Agent', type_name: 'email', ticket: ticket,
|
2021-07-16 13:38:01 +00:00
|
|
|
updated_by_id: agent.id, created_by_id: agent.id)
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
let(:article_note_self) do
|
2020-04-13 18:24:03 +00:00
|
|
|
create(:ticket_article,
|
|
|
|
sender_name: 'Agent', internal: true, type_name: 'note', ticket: ticket,
|
2021-07-16 13:38:01 +00:00
|
|
|
updated_by_id: user.id, created_by_id: user.id)
|
2020-07-13 09:14:15 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
let(:article_note_other) do
|
|
|
|
create(:ticket_article,
|
|
|
|
sender_name: 'Agent', internal: true, type_name: 'note', ticket: ticket,
|
2021-07-16 13:38:01 +00:00
|
|
|
updated_by_id: other_agent.id, created_by_id: other_agent.id)
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
let(:article_note_customer) do
|
|
|
|
create(:ticket_article,
|
|
|
|
sender_name: 'Customer', internal: false, type_name: 'note', ticket: ticket,
|
2021-07-16 13:38:01 +00:00
|
|
|
updated_by_id: customer.id, created_by_id: customer.id)
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
let(:article_note_communication_self) do
|
2020-04-13 18:24:03 +00:00
|
|
|
create(:ticket_article_type, name: 'note_communication', communication: true)
|
|
|
|
|
|
|
|
create(:ticket_article,
|
|
|
|
sender_name: 'Agent', internal: true, type_name: 'note_communication', ticket: ticket,
|
2021-07-16 13:38:01 +00:00
|
|
|
updated_by_id: user.id, created_by_id: user.id)
|
2020-07-13 09:14:15 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
let(:article_note_communication_other) do
|
|
|
|
create(:ticket_article_type, name: 'note_communication', communication: true)
|
|
|
|
|
|
|
|
create(:ticket_article,
|
|
|
|
sender_name: 'Agent', internal: true, type_name: 'note_communication', ticket: ticket,
|
2021-07-16 13:38:01 +00:00
|
|
|
updated_by_id: other_agent.id, created_by_id: other_agent.id)
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
def delete_article_via_rest(article)
|
|
|
|
delete "/api/v1/ticket_articles/#{article.id}", params: {}, as: :json
|
|
|
|
end
|
|
|
|
|
|
|
|
shared_examples 'succeeds' do
|
|
|
|
it 'succeeds' do
|
|
|
|
expect { delete_article_via_rest(article) }.to change { Ticket::Article.exists?(id: article.id) }
|
2019-11-11 15:47:51 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
shared_examples 'fails' do
|
|
|
|
it 'fails' do
|
|
|
|
expect { delete_article_via_rest(article) }.not_to change { Ticket::Article.exists?(id: article.id) }
|
2019-11-11 15:47:51 +00:00
|
|
|
end
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
shared_examples 'deleting' do |item:, now:, later:, much_later:|
|
|
|
|
context "deleting #{item}" do
|
|
|
|
let(:article) { send(item) }
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
include_examples now ? 'succeeds' : 'fails'
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
context '8 minutes later' do
|
|
|
|
before { article && travel(8.minutes) }
|
2019-11-11 15:47:51 +00:00
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
include_examples later ? 'succeeds' : 'fails'
|
2019-11-11 15:47:51 +00:00
|
|
|
end
|
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
context '11 minutes later' do
|
|
|
|
before { article && travel(11.minutes) }
|
|
|
|
|
|
|
|
include_examples much_later ? 'succeeds' : 'fails'
|
2019-11-11 15:47:51 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
context 'as admin' do
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:user) { admin }
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_communication',
|
2020-07-13 09:14:15 +00:00
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_self',
|
|
|
|
now: true, later: true, much_later: false
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
2020-07-13 09:14:15 +00:00
|
|
|
item: 'article_note_other',
|
|
|
|
now: false, later: false, much_later: false
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_customer',
|
2020-07-13 09:14:15 +00:00
|
|
|
now: false, later: false, much_later: false
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
2020-07-13 09:14:15 +00:00
|
|
|
item: 'article_note_communication_self',
|
2020-11-19 16:01:07 +00:00
|
|
|
now: true, later: true, much_later: false
|
2020-07-13 09:14:15 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_communication_other',
|
|
|
|
now: false, later: false, much_later: false
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'as agent' do
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:user) { agent }
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_communication',
|
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
2020-07-13 09:14:15 +00:00
|
|
|
item: 'article_note_self',
|
2020-04-13 18:24:03 +00:00
|
|
|
now: true, later: true, much_later: false
|
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_other',
|
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
2020-04-13 18:24:03 +00:00
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_customer',
|
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
2020-07-13 09:14:15 +00:00
|
|
|
item: 'article_note_communication_self',
|
2020-11-19 16:01:07 +00:00
|
|
|
now: true, later: true, much_later: false
|
2020-04-13 18:24:03 +00:00
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_communication_other',
|
|
|
|
now: false, later: false, much_later: false
|
2020-04-13 18:24:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'as customer' do
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:user) { customer }
|
2020-04-13 18:24:03 +00:00
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_communication',
|
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
2020-07-13 09:14:15 +00:00
|
|
|
item: 'article_note_other',
|
2020-04-13 18:24:03 +00:00
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_customer',
|
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
2020-07-13 09:14:15 +00:00
|
|
|
item: 'article_note_communication_self',
|
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
include_examples 'deleting',
|
|
|
|
item: 'article_note_communication_other',
|
2020-04-13 18:24:03 +00:00
|
|
|
now: false, later: false, much_later: false
|
|
|
|
|
|
|
|
end
|
2020-04-13 20:26:09 +00:00
|
|
|
|
|
|
|
context 'with custom timeframe' do
|
|
|
|
before { Setting.set 'ui_ticket_zoom_article_delete_timeframe', 6000 }
|
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
let(:article) { article_note_self }
|
2020-04-13 20:26:09 +00:00
|
|
|
|
|
|
|
context 'as admin' do
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:user) { admin }
|
2020-04-13 20:26:09 +00:00
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
context 'deleting before timeframe' do
|
|
|
|
before { article && travel(5000.seconds) }
|
|
|
|
|
|
|
|
include_examples 'succeeds'
|
|
|
|
end
|
|
|
|
|
2020-04-13 20:26:09 +00:00
|
|
|
context 'deleting after timeframe' do
|
|
|
|
before { article && travel(8000.seconds) }
|
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
include_examples 'fails'
|
2020-04-13 20:26:09 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'as agent' do
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:user) { agent }
|
2020-04-13 20:26:09 +00:00
|
|
|
|
|
|
|
context 'deleting before timeframe' do
|
|
|
|
before { article && travel(5000.seconds) }
|
|
|
|
|
|
|
|
include_examples 'succeeds'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'deleting after timeframe' do
|
|
|
|
before { article && travel(8000.seconds) }
|
|
|
|
|
|
|
|
include_examples 'fails'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with timeframe as 0' do
|
|
|
|
before { Setting.set 'ui_ticket_zoom_article_delete_timeframe', 0 }
|
|
|
|
|
2020-07-13 09:14:15 +00:00
|
|
|
let(:article) { article_note_self }
|
2020-04-13 20:26:09 +00:00
|
|
|
|
|
|
|
context 'as agent' do
|
2020-06-19 09:17:18 +00:00
|
|
|
let(:user) { agent }
|
2020-04-13 20:26:09 +00:00
|
|
|
|
|
|
|
context 'deleting long after' do
|
|
|
|
before { article && travel(99.days) }
|
|
|
|
|
|
|
|
include_examples 'succeeds'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-11-11 15:47:51 +00:00
|
|
|
end
|
2018-09-19 13:54:49 +00:00
|
|
|
end
|