Skip to content

Commit

Permalink
First draft of Zendesk import and integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsteneckel committed Dec 17, 2015
1 parent 23bb045 commit e5245c6
Show file tree
Hide file tree
Showing 6 changed files with 1,512 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -32,6 +32,8 @@ gem 'omniauth-facebook'
gem 'omniauth-linkedin'
gem 'omniauth-google-oauth2'

gem 'zendesk_api'

gem 'twitter'
gem 'koala'
gem 'mail', '~> 2.5.0'
Expand Down
12 changes: 11 additions & 1 deletion Gemfile.lock
Expand Up @@ -130,6 +130,7 @@ GEM
http_parser.rb (0.6.0)
i18n (0.7.0)
icalendar (2.3.0)
inflection (1.0.0)
json (1.8.3)
jwt (1.5.2)
koala (2.2.0)
Expand Down Expand Up @@ -259,6 +260,7 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
scrub_rb (1.0.1)
selenium-webdriver (2.48.1)
childprocess (~> 0.5)
multi_json (~> 1.0)
Expand Down Expand Up @@ -317,6 +319,13 @@ GEM
unf_ext (0.0.7.1)
websocket (1.2.2)
writeexcel (1.0.5)
zendesk_api (1.13.1)
faraday (~> 0.9)
hashie (>= 1.2, < 4.0, != 3.3.0)
inflection
mime-types
multipart-post (~> 2.0)
scrub_rb (~> 1.0.1)

PLATFORMS
ruby
Expand Down Expand Up @@ -371,6 +380,7 @@ DEPENDENCIES
twitter
uglifier
writeexcel
zendesk_api

BUNDLED WITH
1.10.6
1.11.0
61 changes: 61 additions & 0 deletions db/migrate/20151217191239_zendesk_import_settings.rb
@@ -0,0 +1,61 @@
class ZendeskImportSettings < ActiveRecord::Migration
def change

Setting.create_if_not_exists(
title: 'Import Endpoint',
name: 'import_zendesk_endpoint',
area: 'Import::Zendesk',
description: 'Defines Zendesk endpoint to import users, ticket, states and articles.',
options: {
form: [
{
display: '',
null: false,
name: 'import_zendesk_endpoint',
tag: 'input',
},
],
},
state: 'https://yours.zendesk.com/api/v2',
frontend: false
)

Setting.create_if_not_exists(
title: 'Import Key for requesting the Zendesk API',
name: 'import_zendesk_endpoint_key',
area: 'Import::Zendesk',
description: 'Defines Zendesk endpoint auth key.',
options: {
form: [
{
display: '',
null: false,
name: 'import_zendesk_endpoint_key',
tag: 'input',
},
],
},
state: '',
frontend: false
)

Setting.create_if_not_exists(
title: 'Import User for requesting the Zendesk API',
name: 'import_zendesk_endpoint_username',
area: 'Import::Zendesk',
description: 'Defines Zendesk endpoint auth key.',
options: {
form: [
{
display: '',
null: true,
name: 'import_zendesk_endpoint_username',
tag: 'input',
},
],
},
state: '',
frontend: false
)
end
end
64 changes: 60 additions & 4 deletions db/seeds.rb
Expand Up @@ -1381,10 +1381,10 @@
)

Setting.create_if_not_exists(
title: 'Import User for http basic authentiation',
title: 'Import User for http basic authentication',
name: 'import_otrs_user',
area: 'Import::OTRS',
description: 'Defines http basic authentiation user (only if OTRS is protected via http basic auth).',
description: 'Defines http basic authentication user (only if OTRS is protected via http basic auth).',
options: {
form: [
{
Expand All @@ -1400,10 +1400,10 @@
)

Setting.create_if_not_exists(
title: 'Import Password for http basic authentiation',
title: 'Import Password for http basic authentication',
name: 'import_otrs_password',
area: 'Import::OTRS',
description: 'Defines http basic authentiation password (only if OTRS is protected via http basic auth).',
description: 'Defines http basic authentication password (only if OTRS is protected via http basic auth).',
options: {
form: [
{
Expand All @@ -1418,6 +1418,62 @@
frontend: false
)

Setting.create_if_not_exists(
title: 'Import Endpoint',
name: 'import_zendesk_endpoint',
area: 'Import::Zendesk',
description: 'Defines Zendesk endpoint to import users, ticket, states and articles.',
options: {
form: [
{
display: '',
null: false,
name: 'import_zendesk_endpoint',
tag: 'input',
},
],
},
state: 'https://yours.zendesk.com/api/v2',
frontend: false
)
Setting.create_if_not_exists(
title: 'Import Key for requesting the Zendesk API',
name: 'import_zendesk_endpoint_key',
area: 'Import::Zendesk',
description: 'Defines Zendesk endpoint auth key.',
options: {
form: [
{
display: '',
null: false,
name: 'import_zendesk_endpoint_key',
tag: 'input',
},
],
},
state: '',
frontend: false
)

Setting.create_if_not_exists(
title: 'Import User for requesting the Zendesk API',
name: 'import_zendesk_endpoint_username',
area: 'Import::Zendesk',
description: 'Defines Zendesk endpoint auth key.',
options: {
form: [
{
display: '',
null: true,
name: 'import_zendesk_endpoint_username',
tag: 'input',
},
],
},
state: '',
frontend: false
)

Setting.create_if_not_exists(
title: 'Default calendar Tickets subscriptions',
name: 'defaults_calendar_subscriptions_tickets',
Expand Down

0 comments on commit e5245c6

Please sign in to comment.