diff --git a/spec/controllers/answer_controller_spec.rb b/spec/controllers/answer_controller_spec.rb index f58be191..b2c39fd5 100644 --- a/spec/controllers/answer_controller_spec.rb +++ b/spec/controllers/answer_controller_spec.rb @@ -1,10 +1,14 @@ -require 'rails_helper' +# frozen_string_literal: true + +require "rails_helper" describe AnswerController do - let(:user) { FactoryBot.create :user, - otp_module: :disabled, - otp_secret_key: 'AAAAAAAA'} - let(:answer) { FactoryBot.create :answer, user: user } + let(:user) do + FactoryBot.create :user, + otp_module: :disabled, + otp_secret_key: "AAAAAAAA" + end + let(:answer) { FactoryBot.create :answer, user: } describe "#show" do subject { get :show, params: { username: user.screen_name, id: answer.id } } @@ -22,11 +26,11 @@ describe AnswerController do context "user opts out of search indexing" do render_views - before(:each) { + before(:each) do sign_in user user.privacy_noindex = true user.save - } + end it "renders the answer/show template" do subject diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index cccb727b..de804e32 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -25,11 +25,11 @@ describe UserController, type: :controller do context "user opts out of search indexing" do render_views - before(:each) { + before(:each) do sign_in user user.privacy_noindex = true user.save - } + end it "renders the answer/show template" do subject