mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 01:02:51 +08:00
Use webmock to stub external web requests.
This commit is contained in:
@ -74,7 +74,8 @@ describe UploadsController do
|
||||
controller.stubs(:is_api?).returns(true)
|
||||
|
||||
Jobs.expects(:enqueue).with(:create_avatar_thumbnails, anything)
|
||||
Excon.stub({ method: :head, hostname: 'example.com' }, {})
|
||||
|
||||
stub_request(:head, 'http://example.com/image.png')
|
||||
stub_request(:get, "http://example.com/image.png").to_return(body: File.read('spec/fixtures/images/logo.png'))
|
||||
|
||||
xhr :post, :create, url: 'http://example.com/image.png', type: "avatar", synchronous: true
|
||||
|
Reference in New Issue
Block a user