Module: Panmind::SSLHelper::TestHelpers

Defined in:
lib/panmind/ssl_helper.rb

Overview

Filters

Instance Method Summary collapse

Instance Method Details

#forget_sslObject



185
186
187
188
# File 'lib/panmind/ssl_helper.rb', line 185

def forget_ssl
  @request.env['HTTPS']       = nil
  @request.env['SERVER_PORT'] = 80
end

#use_sslObject



180
181
182
183
# File 'lib/panmind/ssl_helper.rb', line 180

def use_ssl
  @request.env['HTTPS']       = 'on'
  @request.env['SERVER_PORT'] = 443
end

#with_ssl(&block) ⇒ Object



166
167
168
169
170
171
# File 'lib/panmind/ssl_helper.rb', line 166

def with_ssl(&block)
  save_ssl_and do
    use_ssl
    block.call
  end
end

#without_ssl(&block) ⇒ Object



173
174
175
176
177
178
# File 'lib/panmind/ssl_helper.rb', line 173

def without_ssl(&block)
  save_ssl_and do
    forget_ssl
    block.call
  end
end