diff --git a/spec/controllers/answer_controller_spec.rb b/spec/controllers/answer_controller_spec.rb index bca4b142..f58be191 100644 --- a/spec/controllers/answer_controller_spec.rb +++ b/spec/controllers/answer_controller_spec.rb @@ -18,5 +18,21 @@ describe AnswerController do expect(response).to render_template("answer/show") end end + + context "user opts out of search indexing" do + render_views + + before(:each) { + sign_in user + user.privacy_noindex = true + user.save + } + + it "renders the answer/show template" do + subject + expect(assigns(:answer)).to eq(answer) + expect(response.body).to include("") + end + end end end diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 11599f0a..cccb727b 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -21,6 +21,22 @@ describe UserController, type: :controller do expect(response).to render_template("user/show") end end + + context "user opts out of search indexing" do + render_views + + before(:each) { + sign_in user + user.privacy_noindex = true + user.save + } + + it "renders the answer/show template" do + subject + expect(assigns(:user)).to eq(user) + expect(response.body).to include("") + end + end end describe "#followers" do