Fix rubocop offenses
This commit is contained in:
parent
718b1dddfe
commit
eefc46e0d5
|
@ -20,10 +20,7 @@ describe Admin::SpamLogsController do
|
||||||
|
|
||||||
describe '#destroy' do
|
describe '#destroy' do
|
||||||
it 'removes only the spam log when removing log' do
|
it 'removes only the spam log when removing log' do
|
||||||
expect {
|
expect { delete :destroy, id: first_spam.id }.to change { SpamLog.count }.by(-1)
|
||||||
delete :destroy, id: first_spam.id
|
|
||||||
}.to change { SpamLog.count }.by(-1)
|
|
||||||
|
|
||||||
expect(User.find(user.id)).to be_truthy
|
expect(User.find(user.id)).to be_truthy
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
end
|
end
|
||||||
|
|
|
@ -249,12 +249,16 @@ describe API::API, api: true do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not create a new project issue" do
|
let(:params) do
|
||||||
expect {
|
{
|
||||||
post api("/projects/#{project.id}/issues", user),
|
title: 'new issue',
|
||||||
title: 'new issue', description: 'content here', labels: 'label, label2'
|
description: 'content here',
|
||||||
}.not_to change(Issue, :count)
|
labels: 'label, label2'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should not create a new project issue" do
|
||||||
|
expect { post api("/projects/#{project.id}/issues", user), params }.not_to change(Issue, :count)
|
||||||
expect(response.status).to eq(400)
|
expect(response.status).to eq(400)
|
||||||
expect(json_response['message']).to eq({ "error" => "Spam detected" })
|
expect(json_response['message']).to eq({ "error" => "Spam detected" })
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue