Merge commit '8ee6cee36e313fcc39763210dfcd3b871b47cacb' into glitch-soc/merge-upstream
This commit is contained in:
commit
3efc857fbc
75 files changed
+1924
-253
No files matched your search
@@ -32,13 +32,27 @@ RSpec.describe Fasp::Request do
|
||||
context 'when the response is not signed' do
|
||||
before do
|
||||
stub_request(method, 'https://reqprov.example.com/fasp/test_path')
|
||||
.to_return(status: 200)
|
||||
.to_return(status:)
|
||||
end
|
||||
|
||||
it 'raises an error' do
|
||||
expect do
|
||||
subject.send(method, '/test_path')
|
||||
end.to raise_error(Mastodon::SignatureVerificationError)
|
||||
context 'when the request was successful' do
|
||||
let(:status) { 200 }
|
||||
|
||||
it 'raises a signature verification error' do
|
||||
expect do
|
||||
subject.send(method, '/test_path')
|
||||
end.to raise_error(Mastodon::SignatureVerificationError)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when an error response is received' do
|
||||
let(:status) { 401 }
|
||||
|
||||
it 'raises an unexpected response error' do
|
||||
expect do
|
||||
subject.send(method, '/test_path')
|
||||
end.to raise_error(Mastodon::UnexpectedResponseError)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user