2016-11-25 16:10:37 +00:00
|
|
|
require 'rails_helper'
|
2017-03-27 09:25:45 +00:00
|
|
|
require 'lib/import/helper_examples'
|
2016-11-25 16:10:37 +00:00
|
|
|
|
|
|
|
RSpec.describe Import::Helper do
|
|
|
|
it_behaves_like 'Import::Helper'
|
|
|
|
|
|
|
|
it 'checks if import_mode is active' do
|
|
|
|
expect(Setting).to receive(:get).with('import_mode').and_return(true)
|
|
|
|
expect( described_class.check_import_mode ).to be true
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'throws an exception if import_mode is disabled' do
|
|
|
|
expect(Setting).to receive(:get).with('import_mode').and_return(false)
|
|
|
|
expect { described_class.check_import_mode }.to raise_error(RuntimeError)
|
|
|
|
end
|
|
|
|
end
|