mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:29:54 +01:00
Add tests for noindex setting
This commit is contained in:
parent
4c820b472e
commit
23fe0a2c6e
2 changed files with 32 additions and 0 deletions
|
@ -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("<meta content='noindex' name='robots'>")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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("<meta content='noindex' name='robots'>")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#followers" do
|
||||
|
|
Loading…
Reference in a new issue