cartodb-4.42/services/datasources/spec/unit/box_spec.rb

32 lines
691 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
require_relative '../../lib/datasources'
require_relative '../doubles/user'
include CartoDB::Datasources
describe Url::Box do
def get_config
{
'box_host' => '',
'application_name' => '',
'client_id' => '',
'client_secret' => '',
'callback_url' => ''
}
end
describe '#filters' do
it 'test that filter sets correctly' do
user_mock = CartoDB::Datasources::Doubles::User.new
box_provider = Url::Box.get_new(get_config, user_mock)
box_provider.filter.should eq nil
# Filter to 'documents'
formats = ['csv', 'xls']
box_provider.filter = formats
box_provider.filter.should eq formats
end
end
end