Fix rubocop offenses

parent 718b1ddd
......@@ -20,10 +20,7 @@ describe Admin::SpamLogsController do
describe '#destroy' do
it 'removes only the spam log when removing log' do
expect {
delete :destroy, id: first_spam.id
}.to change { SpamLog.count }.by(-1)
expect { delete :destroy, id: first_spam.id }.to change { SpamLog.count }.by(-1)
expect(User.find(user.id)).to be_truthy
expect(response.status).to eq(200)
end
......
......@@ -249,12 +249,16 @@ describe API::API, api: true do
end
end
it "should not create a new project issue" do
expect {
post api("/projects/#{project.id}/issues", user),
title: 'new issue', description: 'content here', labels: 'label, label2'
}.not_to change(Issue, :count)
let(:params) do
{
title: 'new issue',
description: 'content here',
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(json_response['message']).to eq({ "error" => "Spam detected" })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment