Fix rubocop offenses

parent 718b1ddd
...@@ -20,10 +20,7 @@ describe Admin::SpamLogsController do ...@@ -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 ...@@ -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" })
......
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