Visitar URL original
Rewind Files After Reading the Files During Webhook Request Verification by BrianBorge · Pull Request #51 · phaxio/phaxio-ruby · GitHub
Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add spec for webhook signature validation with files
  • Loading branch information
BrianBorge committed Dec 8, 2023
commit c4b74a4bf6f386d9c3ea63dd315a3320fb89f245
17 changes: 17 additions & 0 deletions spec/resources/webhook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,22 @@
expect(result).to eq(false)
end
end

context 'with files' do
let(:signature) { '1d2426c242a8c5de7eb1d9b662b7fda1d0b6edab' }
let(:params) { { test: true } }

let(:files) do
[
{ name: 'file', tempfile: Tempfile.new('foo') },
{ name: 'file', tempfile: Tempfile.new('bar') }
]
end

it 'returns true' do
result = action
expect(result).to eq(true)
end
end
end
end