Skip to content

Commit

Permalink
Add testcase for a ignored push event from github to scm_webhook spec
Browse files Browse the repository at this point in the history
  • Loading branch information
krauselukas committed Feb 17, 2023
1 parent bf50685 commit fd71d3f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/api/spec/models/scm_webhook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,20 @@
it { is_expected.to be true }
end
end

describe '#ignored_push_event?' do
subject { described_class.new(payload: payload).ignored_push_event? }

context 'with a push event from GitHub for a deleted commit reference' do
let(:payload) { { scm: 'github', event: 'push', ref: 'refs/heads/branch_123', deleted: true } }

it { is_expected.to be true }
end

context 'with a push event from GitHub without a deleted commit reference' do
let(:payload) { { scm: 'github', event: 'push', ref: 'refs/heads/branch_123', deleted: false } }

it { is_expected.to be false }
end
end
end

0 comments on commit fd71d3f

Please sign in to comment.