2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2016-11-25 16:10:37 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
def history_from_json(file, zammad_structure)
|
|
|
|
expect(History).to receive(:add).with(zammad_structure)
|
|
|
|
described_class.new(load_history_json(file))
|
|
|
|
end
|
|
|
|
|
|
|
|
def load_history_json(file)
|
|
|
|
json_fixture("import/otrs/history/#{file}")
|
|
|
|
end
|
|
|
|
|
|
|
|
RSpec.shared_examples 'Import::OTRS::History' do
|
|
|
|
it 'responds to init_callback' do
|
2016-11-29 11:56:24 +00:00
|
|
|
expect(::History).to receive(:add)
|
2020-08-03 08:35:43 +00:00
|
|
|
allow(::History::Attribute).to receive(:exists?).and_return(true)
|
2016-11-25 16:10:37 +00:00
|
|
|
blank_instance = described_class.new({})
|
|
|
|
expect(blank_instance).to respond_to('init_callback')
|
|
|
|
end
|
|
|
|
end
|