mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Fix all the errors to get our tests green on Rails 5.1.
This commit is contained in:
@ -15,7 +15,7 @@ describe "Discobot Certificate" do
|
||||
stub_request(:get, "http://test.localhost//images/d-logo-sketch-small.png")
|
||||
.to_return(status: 200)
|
||||
|
||||
xhr :get, '/discobot/certificate.svg', params
|
||||
get '/discobot/certificate.svg', params: params
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
@ -28,7 +28,7 @@ describe "Discobot Certificate" do
|
||||
}
|
||||
|
||||
params.each do |key, _|
|
||||
expect { xhr :get, '/discobot/certificate.svg', params.except(key) }
|
||||
expect { get '/discobot/certificate.svg', params: params.except(key) }
|
||||
.to raise_error(Discourse::InvalidParameters)
|
||||
end
|
||||
end
|
||||
@ -37,11 +37,12 @@ describe "Discobot Certificate" do
|
||||
describe 'when date is invalid' do
|
||||
it 'should raise the right error' do
|
||||
expect do
|
||||
xhr :get, '/discobot/certificate.svg',
|
||||
get '/discobot/certificate.svg', params: {
|
||||
name: user.name,
|
||||
date: "<script type=\"text/javascript\">alert('This app is probably vulnerable to XSS attacks!');</script>",
|
||||
avatar_url: 'https://somesite.com/someavatar',
|
||||
user_id: user.id
|
||||
}
|
||||
end.to raise_error(ArgumentError, 'invalid date')
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user