summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/utils/deep_size_spec.rb6
-rw-r--r--spec/lib/sentry/client_spec.rb9
2 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/utils/deep_size_spec.rb b/spec/lib/gitlab/utils/deep_size_spec.rb
index 47dfc04f46f..ccd202b33f7 100644
--- a/spec/lib/gitlab/utils/deep_size_spec.rb
+++ b/spec/lib/gitlab/utils/deep_size_spec.rb
@@ -42,4 +42,10 @@ describe Gitlab::Utils::DeepSize do
end
end
end
+
+ describe '.human_default_max_size' do
+ it 'returns 1 MB' do
+ expect(described_class.human_default_max_size).to eq('1 MB')
+ end
+ end
end
diff --git a/spec/lib/sentry/client_spec.rb b/spec/lib/sentry/client_spec.rb
index ca2b17b44e0..8101664d34f 100644
--- a/spec/lib/sentry/client_spec.rb
+++ b/spec/lib/sentry/client_spec.rb
@@ -192,6 +192,15 @@ describe Sentry::Client do
end
end
+ context 'sentry api response too large' do
+ it 'raises exception' do
+ deep_size = double('Gitlab::Utils::DeepSize', valid?: false)
+ allow(Gitlab::Utils::DeepSize).to receive(:new).with(sentry_api_response).and_return(deep_size)
+
+ expect { subject }.to raise_error(Sentry::Client::ResponseInvalidSizeError, 'Sentry API response is too big. Limit is 1 MB.')
+ end
+ end
+
it_behaves_like 'maps exceptions'
end