FEATURE: add referrer never tag to password reset page

This commit is contained in:
Sam 2016-12-19 11:01:58 +11:00
parent 15b5fddd49
commit 0599bd0154
2 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,7 @@
</div>
<%- content_for(:no_ember_head) do %>
<meta name="referrer" content="never">
<%= script "ember_jquery" %>
<%= render_google_universal_analytics_code %>
<%- end %>

View File

@ -237,6 +237,18 @@ describe UsersController do
end
context 'valid token' do
context 'when rendered' do
render_views
it 'renders referrer never on get requests' do
user = Fabricate(:user, auth_token: SecureRandom.hex(16))
token = user.email_tokens.create(email: user.email).token
get :password_reset, token: token
expect(response.body).to include('<meta name="referrer" content="never">')
end
end
it 'returns success' do
user = Fabricate(:user, auth_token: SecureRandom.hex(16))
token = user.email_tokens.create(email: user.email).token