Fix lints

This commit is contained in:
Andreas Nedbal 2022-11-21 23:07:18 +01:00
parent d9991f5fa7
commit 1c4993df3f
2 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,6 @@ class AnonymousBlockController < ApplicationController
params.require :question params.require :question
question = Question.find(params[:question]) question = Question.find(params[:question])
authorize AnonymousBlock, :create_global? if params[:global] authorize AnonymousBlock, :create_global? if params[:global]
AnonymousBlock.create!( AnonymousBlock.create!(

View File

@ -4,7 +4,7 @@ require "rails_helper"
describe AnonymousBlockController, type: :controller do describe AnonymousBlockController, type: :controller do
describe "#create" do describe "#create" do
subject { post(:create, params: params) } subject { post(:create, params:) }
context "user signed in" do context "user signed in" do
let(:user) { FactoryBot.create(:user) } let(:user) { FactoryBot.create(:user) }
@ -53,7 +53,7 @@ describe AnonymousBlockController, type: :controller do
end end
describe "#destroy" do describe "#destroy" do
subject { delete(:destroy, params: params) } subject { delete(:destroy, params:) }
context "user signed in" do context "user signed in" do
let(:user) { FactoryBot.create(:user) } let(:user) { FactoryBot.create(:user) }
@ -64,7 +64,7 @@ describe AnonymousBlockController, type: :controller do
context "when all parameters are given" do context "when all parameters are given" do
let(:question) { FactoryBot.create(:question, author_identifier: "someidentifier") } let(:question) { FactoryBot.create(:question, author_identifier: "someidentifier") }
let(:block) { AnonymousBlock.create(user: user, identifier: "someidentifier", question: question) } let(:block) { AnonymousBlock.create(user:, identifier: "someidentifier", question:) }
let(:params) do let(:params) do
{ id: block.id } { id: block.id }
end end