summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-03-01 11:13:12 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-03-01 11:13:12 +0000
commitedbf6204c013f125447a8b0f1310400336f39628 (patch)
tree06aeaf0e78a9c02e2dd53083bf1a0ff4fa4d47a7 /spec/workers
parentd7b3a71119eefa1dc84e75f91676bad3e2f386f8 (diff)
parent7aa9ec7aa11fee1de915a15c15b5ee164b2f51a4 (diff)
downloadgitlab-ce-edbf6204c013f125447a8b0f1310400336f39628.tar.gz
Merge branch 'master' into fl-document-key-vue
* master: (53 commits) init sidebar bundle separately to allow EE override Add support for custom container class Update class init config Update FilteredSearchManager init config Add group related config and endpoint methods to be consistent with EE Tag migration specs with :sidekiq to clear queues between tests Add update for packed-refs with git v2.16 Bump GitLab CI test image to use git v2.16 Ignore InlineJavaScript linter in existing script tag locations. Update inline_javascript.rb to lint uses of the javascript filter as well as script tags. Update inline_javascript.rb Forbid all inline script tags in Linter::InlineJavaScript Remove webpack bundle tag for enviroments remove a bunch of superfluous common_vue bundles Remove use of any_instance_of in runner spec Remove trailing line from plugin logger Improve plugins documentation and remove unnecessary rake task Refactor plugins feature and make some doc improvements prefer let and const in webpack config remove common_vue from CommonsChunkPlugin ...
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/plugin_worker_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/workers/plugin_worker_spec.rb b/spec/workers/plugin_worker_spec.rb
new file mode 100644
index 00000000000..9238a8199bc
--- /dev/null
+++ b/spec/workers/plugin_worker_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe PluginWorker do
+ include RepoHelpers
+
+ let(:filename) { 'my_plugin.rb' }
+ let(:data) { { 'event_name' => 'project_create' } }
+
+ subject { described_class.new }
+
+ describe '#perform' do
+ it 'executes Gitlab::Plugin with expected values' do
+ allow(Gitlab::Plugin).to receive(:execute).with(filename, data).and_return([true, ''])
+
+ expect(subject.perform(filename, data)).to be_truthy
+ end
+
+ it 'logs message in case of plugin execution failure' do
+ allow(Gitlab::Plugin).to receive(:execute).with(filename, data).and_return([false, 'permission denied'])
+
+ expect(Gitlab::PluginLogger).to receive(:error)
+ expect(subject.perform(filename, data)).to be_truthy
+ end
+ end
+end