about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-20 01:58:46 -0500
committerGitHub <noreply@github.com>2023-02-20 07:58:46 +0100
commit2c3c734bcc5e485a59145b78f5c783ca9a462cb7 (patch)
tree808f57fe777b0e68a488715b43f9505ad7bad298 /spec/lib
parentaf4c95100c519ea63c9d8a3e9a3f900091933ce2 (diff)
Autofix Rubocop Style/SymbolProc (#23742)
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/request_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/lib/request_spec.rb b/spec/lib/request_spec.rb
index f63a836de..25fe9ed37 100644
--- a/spec/lib/request_spec.rb
+++ b/spec/lib/request_spec.rb
@@ -97,12 +97,12 @@ describe Request do
   describe "response's body_with_limit method" do
     it 'rejects body more than 1 megabyte by default' do
       stub_request(:any, 'http://example.com').to_return(body: SecureRandom.random_bytes(2.megabytes))
-      expect { subject.perform { |response| response.body_with_limit } }.to raise_error Mastodon::LengthValidationError
+      expect { subject.perform(&:body_with_limit) }.to raise_error Mastodon::LengthValidationError
     end
 
     it 'accepts body less than 1 megabyte by default' do
       stub_request(:any, 'http://example.com').to_return(body: SecureRandom.random_bytes(2.kilobytes))
-      expect { subject.perform { |response| response.body_with_limit } }.to_not raise_error
+      expect { subject.perform(&:body_with_limit) }.to_not raise_error
     end
 
     it 'rejects body by given size' do
@@ -112,12 +112,12 @@ describe Request do
 
     it 'rejects too large chunked body' do
       stub_request(:any, 'http://example.com').to_return(body: SecureRandom.random_bytes(2.megabytes), headers: { 'Transfer-Encoding' => 'chunked' })
-      expect { subject.perform { |response| response.body_with_limit } }.to raise_error Mastodon::LengthValidationError
+      expect { subject.perform(&:body_with_limit) }.to raise_error Mastodon::LengthValidationError
     end
 
     it 'rejects too large monolithic body' do
       stub_request(:any, 'http://example.com').to_return(body: SecureRandom.random_bytes(2.megabytes), headers: { 'Content-Length' => 2.megabytes })
-      expect { subject.perform { |response| response.body_with_limit } }.to raise_error Mastodon::LengthValidationError
+      expect { subject.perform(&:body_with_limit) }.to raise_error Mastodon::LengthValidationError
     end
 
     it 'truncates large monolithic body' do