DEV: Correct specs which had exceptions raised in jobs
This commit is contained in:
parent
20cda5d689
commit
3987691b5e
|
@ -529,7 +529,7 @@ describe DiscourseSingleSignOn do
|
|||
sso.avatar_url = "http://awesome.com/image.png"
|
||||
sso.suppress_welcome_message = true
|
||||
|
||||
FileHelper.stubs(:download).returns(file_from_fixtures("logo.png"))
|
||||
FileHelper.stubs(:download).returns(file_from_fixtures("logo.png"), file_from_fixtures("logo.png"))
|
||||
user = sso.lookup_or_create_user(ip_address)
|
||||
user.reload
|
||||
avatar_id = user.uploaded_avatar_id
|
||||
|
@ -540,8 +540,7 @@ describe DiscourseSingleSignOn do
|
|||
# junk avatar id should be updated
|
||||
old_id = user.uploaded_avatar_id
|
||||
Upload.destroy(old_id)
|
||||
|
||||
FileHelper.stubs(:download).returns(file_from_fixtures("logo.png"))
|
||||
FileHelper.stubs(:download).returns(file_from_fixtures("logo.png"), file_from_fixtures("logo.png"))
|
||||
user = sso.lookup_or_create_user(ip_address)
|
||||
user.reload
|
||||
avatar_id = user.uploaded_avatar_id
|
||||
|
|
|
@ -140,7 +140,11 @@ describe EmbedController do
|
|||
end
|
||||
|
||||
it "provides the topic retriever with the discourse username when provided" do
|
||||
TopicRetriever.expects(:new).with(embed_url, has_entry(author_username: discourse_username))
|
||||
retriever = mock
|
||||
retriever.expects(:retrieve).returns(nil)
|
||||
TopicRetriever.expects(:new)
|
||||
.with(embed_url, has_entry(author_username: discourse_username))
|
||||
.returns(retriever)
|
||||
|
||||
get '/embed/comments',
|
||||
params: { embed_url: embed_url, discourse_username: discourse_username },
|
||||
|
|
|
@ -615,10 +615,12 @@ describe PostAlerter do
|
|||
body = nil
|
||||
headers = nil
|
||||
|
||||
Excon.expects(:post).with { |_req, _body|
|
||||
headers = _body[:headers]
|
||||
body = _body[:body]
|
||||
}.times(3).returns("OK")
|
||||
stub_request(:post, "https://site2.com/push")
|
||||
.to_return do |request|
|
||||
body = request.body
|
||||
headers = request.headers
|
||||
{ status: 200, body: "OK" }
|
||||
end
|
||||
|
||||
payload = {
|
||||
"secret_key" => SiteSetting.push_api_secret_key,
|
||||
|
|
Loading…
Reference in New Issue