Railsã®ã³ã³ããã¼ã©ã®SSLã»éSSLã®ã¨ãã®æ¯ãèãããã¹ãããã«ã¯ request.env['HTTPS'] ã« 'on' ã 'off' ãä»£å ¥ããã°ããã describe SomeController do describe 'GET new' do context 'access using SSL' do before { request.env['HTTPS'] = 'on' } it do get :new # SSLã§ã¢ã¯ã»ã¹ãã end end context 'access not using SSL' do before { request.env['HTTPS'] = 'off' } # ãã®ä¸ã¯éSSL end end end
{{#tags}}- {{label}}
{{/tags}}