zendesk_apps_tools 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd8fa7aee06e73ef92024f7f6a9faa862385cae1
|
4
|
+
data.tar.gz: ad97829c73dcf87c66b883181ddea93a1644570d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f08f861c9459796999f1c64d7ab05b10bba4018368c7197220161c570b3a27d02f23e60aebd7cbf5220527cf1580af53c8504288a88c723bf94f6a8f92e1e8c
|
7
|
+
data.tar.gz: 813614e2cabbd9be1222f2fc84f8abe3199191d050bc588127998daba2fa906e098953c04721e6b194cf543ba9791bf16a66a0e0d516d6be3ae1ac8f952aa4a9
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Feature: upload an app to the apps marketplace
|
2
|
+
Background: create a new zendesk app
|
3
|
+
|
4
|
+
Scenario: package a zendesk app by running 'zat create --no-install' command
|
5
|
+
Given an app is created in directory "tmp/aruba"
|
6
|
+
Given a .zat file in "tmp/aruba"
|
7
|
+
When I run the command "zat create --path tmp/aruba --no-install" to create the app
|
8
|
+
And the command output should contain "validate OK"
|
9
|
+
And the command output should contain "package created"
|
10
|
+
And the command output should contain "Status working"
|
11
|
+
And the command output should contain "Create OK"
|
12
|
+
And the zip file should exist in directory "tmp/aruba/tmp"
|
@@ -31,6 +31,12 @@ Given /^a(n|(?: v1)) app is created in directory "(.*?)"$/ do |version, app_dir|
|
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
34
|
+
Given /^a \.zat file in "(.*?)"/ do |app_dir|
|
35
|
+
f = File.new(File.join(app_dir, '.zat'), 'w')
|
36
|
+
f.write(JSON.dump(username: 'test@user.com', password: 'hunter2', subdomain: 'app-account'))
|
37
|
+
f.close
|
38
|
+
end
|
39
|
+
|
34
40
|
When /^I run "(.*?)" command with the following details:$/ do |cmd, table|
|
35
41
|
IO.popen(cmd, 'w+') do |pipe|
|
36
42
|
# [ ['parameter name', 'value'] ]
|
@@ -49,8 +55,9 @@ When /^I create a symlink from "(.*?)" to "(.*?)"$/ do |src, dest|
|
|
49
55
|
FileUtils.ln_s(src, dest)
|
50
56
|
end
|
51
57
|
|
52
|
-
When /^I run the command "(.*?)" to (validate|package|clean) the app$/ do |cmd, _action|
|
53
|
-
|
58
|
+
When /^I run the command "(.*?)" to (validate|package|clean|create) the app$/ do |cmd, _action|
|
59
|
+
env_hash = prepare_env_hash_for(cmd)
|
60
|
+
IO.popen(env_hash, cmd, 'w+') do |pipe|
|
54
61
|
pipe.puts "\n"
|
55
62
|
pipe.close_write
|
56
63
|
@output = pipe.readlines
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# we only want this file to monkey-patch zat when we shell out to it, but cucumber automatically requires it as well.
|
4
|
+
unless defined?(Cucumber)
|
5
|
+
|
6
|
+
require 'webmock'
|
7
|
+
|
8
|
+
WebMock::API.stub_request(:post, 'https://app-account.zendesk.com/api/v2/apps/uploads.json').to_return(body: JSON.dump(id: '123'))
|
9
|
+
WebMock::API.stub_request(:post, 'https://app-account.zendesk.com/api/v2/apps.json').with(body: JSON.dump(name: 'John Test App', upload_id: '123')).to_return(body: JSON.dump(job_id: '987'))
|
10
|
+
WebMock::API.stub_request(:get, 'https://app-account.zendesk.com/api/v2/apps/job_statuses/987').to_return(body: JSON.dump(status: 'working')).then.to_return(body: JSON.dump(status: 'completed', app_id: '55'))
|
11
|
+
|
12
|
+
WebMock.enable!
|
13
|
+
WebMock.disable_net_connect!
|
14
|
+
end
|
@@ -92,7 +92,7 @@ module ZendeskAppsTools
|
|
92
92
|
desc 'package', 'Package your app'
|
93
93
|
shared_options(except: [:unattended])
|
94
94
|
def package
|
95
|
-
return false unless
|
95
|
+
return false unless validate
|
96
96
|
|
97
97
|
setup_path(options[:path])
|
98
98
|
|
@@ -152,6 +152,7 @@ module ZendeskAppsTools
|
|
152
152
|
method_option :install, default: true, type: :boolean, desc: 'Also create an installation with some settings immediately after uploading.'
|
153
153
|
def create
|
154
154
|
cache.clear
|
155
|
+
setup_path(options[:path])
|
155
156
|
@command = 'Create'
|
156
157
|
|
157
158
|
unless options[:zipfile]
|
@@ -170,6 +171,7 @@ module ZendeskAppsTools
|
|
170
171
|
method_option :zipfile, default: nil, required: false, type: :string
|
171
172
|
def update
|
172
173
|
cache.clear
|
174
|
+
setup_path(options[:path])
|
173
175
|
@command = 'Update'
|
174
176
|
|
175
177
|
app_id = cache.fetch('app_id') || find_app_id
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_apps_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Rosen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-03-
|
14
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|
@@ -209,11 +209,14 @@ files:
|
|
209
209
|
- app_template_iframe/translations/en.json
|
210
210
|
- bin/zat
|
211
211
|
- features/clean.feature
|
212
|
+
- features/create.feature
|
212
213
|
- features/fixtures/quote_character_translation.json
|
213
214
|
- features/new.feature
|
214
215
|
- features/package.feature
|
215
216
|
- features/step_definitions/app_steps.rb
|
216
217
|
- features/support/env.rb
|
218
|
+
- features/support/helpers.rb
|
219
|
+
- features/support/webmock.rb
|
217
220
|
- features/validate.feature
|
218
221
|
- lib/zendesk_apps_tools.rb
|
219
222
|
- lib/zendesk_apps_tools/api_connection.rb
|
@@ -259,9 +262,12 @@ specification_version: 4
|
|
259
262
|
summary: Tools to help you develop Zendesk Apps.
|
260
263
|
test_files:
|
261
264
|
- features/clean.feature
|
265
|
+
- features/create.feature
|
262
266
|
- features/fixtures/quote_character_translation.json
|
263
267
|
- features/new.feature
|
264
268
|
- features/package.feature
|
265
269
|
- features/step_definitions/app_steps.rb
|
266
270
|
- features/support/env.rb
|
271
|
+
- features/support/helpers.rb
|
272
|
+
- features/support/webmock.rb
|
267
273
|
- features/validate.feature
|