summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-02 13:46:02 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-04 17:16:50 -0300
commit51cf14b37c64b1afab25b10dfe94e281ff58d288 (patch)
tree24f62ea7823e43aa6faf64a2f95c3df01325bf8d /spec/lib
parentceff0c91700b15ecf26931c23f40637dcdf7204d (diff)
downloadgitlab-ce-51cf14b37c64b1afab25b10dfe94e281ff58d288.tar.gz
Does not need to disable GitHub webhooks since PRs are check out locally
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/github_import/hook_formatter_spec.rb65
1 files changed, 0 insertions, 65 deletions
diff --git a/spec/lib/gitlab/github_import/hook_formatter_spec.rb b/spec/lib/gitlab/github_import/hook_formatter_spec.rb
deleted file mode 100644
index 110ba428258..00000000000
--- a/spec/lib/gitlab/github_import/hook_formatter_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::GithubImport::HookFormatter, lib: true do
- describe '#id' do
- it 'returns raw id' do
- raw = double(id: 100000)
- formatter = described_class.new(raw)
- expect(formatter.id).to eq 100000
- end
- end
-
- describe '#name' do
- it 'returns raw id' do
- raw = double(name: 'web')
- formatter = described_class.new(raw)
- expect(formatter.name).to eq 'web'
- end
- end
-
- describe '#config' do
- it 'returns raw config.attrs' do
- raw = double(config: double(attrs: { url: 'http://something.com/webhook' }))
- formatter = described_class.new(raw)
- expect(formatter.config).to eq({ url: 'http://something.com/webhook' })
- end
- end
-
- describe '#valid?' do
- it 'returns true when events contains the wildcard event' do
- raw = double(events: ['*', 'commit_comment'], active: true)
- formatter = described_class.new(raw)
- expect(formatter.valid?).to eq true
- end
-
- it 'returns true when events contains the create event' do
- raw = double(events: ['create', 'commit_comment'], active: true)
- formatter = described_class.new(raw)
- expect(formatter.valid?).to eq true
- end
-
- it 'returns true when events contains delete event' do
- raw = double(events: ['delete', 'commit_comment'], active: true)
- formatter = described_class.new(raw)
- expect(formatter.valid?).to eq true
- end
-
- it 'returns true when events contains pull_request event' do
- raw = double(events: ['pull_request', 'commit_comment'], active: true)
- formatter = described_class.new(raw)
- expect(formatter.valid?).to eq true
- end
-
- it 'returns false when events does not contains branch related events' do
- raw = double(events: ['member', 'commit_comment'], active: true)
- formatter = described_class.new(raw)
- expect(formatter.valid?).to eq false
- end
-
- it 'returns false when hook is not active' do
- raw = double(events: ['pull_request', 'commit_comment'], active: false)
- formatter = described_class.new(raw)
- expect(formatter.valid?).to eq false
- end
- end
-end