Sha256: af380acf9bed0869f58b7b76f7c82f62826b7915a9d3a7070e5561218c335924

Contents?: true

Size: 561 Bytes

Versions: 17

Compression:

Stored size: 561 Bytes

Contents

Test::Unit::TestCase.class_eval do
  def self.without_ssl_context
    context "without ssl" do
      setup do
        @request.env['HTTPS'] = nil
      end

      context "" do
        yield
      end
    end
  end

  def self.with_ssl_context
    context "with ssl" do
      setup do
        @request.env['HTTPS'] = 'on'
      end
    
      context "" do
        yield
      end
    end
  end

  def self.should_redirect_to_ssl
    should 'redirect to ssl' do
      assert_redirected_to "https://" + @request.host + @request.request_uri
    end    
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
bartt-ssl_requirement-1.3.1 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.3.0 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.7 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.6 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.5 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.4 shoulda_macros/ssl_requirement_macros.rb
sslrequirement-1.2.0 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.3 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.2 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.1 shoulda_macros/ssl_requirement_macros.rb
bartt-ssl_requirement-1.2.0 shoulda_macros/ssl_requirement_macros.rb
sslrequirement-1.1.1 shoulda_macros/ssl_requirement_macros.rb
shenie-ssl_requirement-1.1.3 shoulda_macros/ssl_requirement_macros.rb
shenie-ssl_requirement-1.1.2 shoulda_macros/ssl_requirement_macros.rb
shenie-ssl_requirement-1.1.1 shoulda_macros/ssl_requirement_macros.rb
revo-ssl_requirement-1.1.0 shoulda_macros/ssl_requirement_macros.rb
revo-ssl_requirement-1.0.0 shoulda_macros/ssl_requirement_macros.rb