Add tests for noindex setting
This commit is contained in:
parent
4c820b472e
commit
23fe0a2c6e
|
@ -18,5 +18,21 @@ describe AnswerController do
|
||||||
expect(response).to render_template("answer/show")
|
expect(response).to render_template("answer/show")
|
||||||
end
|
end
|
||||||
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("<meta content='noindex' name='robots'>")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,6 +21,22 @@ describe UserController, type: :controller do
|
||||||
expect(response).to render_template("user/show")
|
expect(response).to render_template("user/show")
|
||||||
end
|
end
|
||||||
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("<meta content='noindex' name='robots'>")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#followers" do
|
describe "#followers" do
|
||||||
|
|
Loading…
Reference in New Issue