Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
paveg committed Jul 31, 2018
1 parent 43bcef8 commit 549a1f9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/lgtm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ module Danger
expect(@dangerfile.status_report[:markdowns].length).to eq(1)
end

it 'lgtm with default url is OverQuota' do
allow(Net::HTTP).to receive(:start).and_return(mock(code: '503'))

expect(@dangerfile.status_report[:markdowns]).to be_empty
end

def mock(request_url: 'https://lgtm.in/p/sSuI4hm0q',
actual_image_url: 'https://example.com/image.jpg')
actual_image_url: 'https://example.com/image.jpg',
code: '200')
double(
:[] => request_url,
body: JSON.generate(
actualImageUrl: actual_image_url
)
),
code: code
)
end

Expand Down

0 comments on commit 549a1f9

Please sign in to comment.