Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@ -1,43 +1,46 @@
# frozen_string_literal: true
require 'rails_helper'
describe ErrorTemplateAttributesController do
let!(:error_template_attribute) { FactoryBot.create(:error_template_attribute) }
let(:user) { FactoryBot.create(:admin) }
before(:each) { allow(controller).to receive(:current_user).and_return(user) }
it "should get index" do
before { allow(controller).to receive(:current_user).and_return(user) }
it 'gets index' do
get :index
expect(response.status).to eq(200)
expect(assigns(:error_template_attributes)).not_to be_nil
end
it "should get new" do
it 'gets new' do
get :new
expect(response.status).to eq(200)
end
it "should create error_template_attribute" do
expect { post :create, params: { error_template_attribute: { } } }.to change(ErrorTemplateAttribute, :count).by(1)
it 'creates error_template_attribute' do
expect { post :create, params: {error_template_attribute: {}} }.to change(ErrorTemplateAttribute, :count).by(1)
expect(response).to redirect_to(error_template_attribute_path(assigns(:error_template_attribute)))
end
it "should show error_template_attribute" do
get :show, params: { id: error_template_attribute }
it 'shows error_template_attribute' do
get :show, params: {id: error_template_attribute}
expect(response.status).to eq(200)
end
it "should get edit" do
get :edit, params: { id: error_template_attribute }
it 'gets edit' do
get :edit, params: {id: error_template_attribute}
expect(response.status).to eq(200)
end
it "should update error_template_attribute" do
patch :update, params: { id: error_template_attribute, error_template_attribute: FactoryBot.attributes_for(:error_template_attribute) }
it 'updates error_template_attribute' do
patch :update, params: {id: error_template_attribute, error_template_attribute: FactoryBot.attributes_for(:error_template_attribute)}
expect(response).to redirect_to(error_template_attribute_path(assigns(:error_template_attribute)))
end
it "should destroy error_template_attribute" do
expect { delete :destroy, params: { id: error_template_attribute } }.to change(ErrorTemplateAttribute, :count).by(-1)
it 'destroys error_template_attribute' do
expect { delete :destroy, params: {id: error_template_attribute} }.to change(ErrorTemplateAttribute, :count).by(-1)
expect(response).to redirect_to(error_template_attributes_path)
end
end