Sha256: 5839bc94ac87865a65a0881c7ef8ab1e7fc148501415fbbfdabbf29f427c6f38

Contents?: true

Size: 993 Bytes

Versions: 4

Compression:

Stored size: 993 Bytes

Contents

module Merb::Test::Fixtures::Controllers

  class Testing < Merb::Controller
    self._template_root = File.dirname(__FILE__) / "views"
  end

  class BasicAuthentication < Testing
    before :authenticate, :only => :index

    def index
      "authenticated"
    end

    protected

    def authenticate
      basic_authentication { |u, p| u == "Fred" && p == "secret" }
    end
  end

  class BasicAuthenticationWithRealm < BasicAuthentication
    def authenticate
      basic_authentication("My Super App") { |u, p| u == "Fred" && p == "secret" }
    end
  end

  class AuthenticateBasicAuthentication < Testing
    def index
      basic_authentication.authenticate { |u, p| "Fred:secret" }
    end
  end

  class RequestBasicAuthentication < BasicAuthentication
    def authenticate
      basic_authentication.request
    end
  end

  class RequestBasicAuthenticationWithRealm < BasicAuthentication
    def authenticate
      basic_authentication("My SuperApp").request
    end
  end

end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
thorero-0.9.4.5 spec/public/controller/controllers/authentication.rb
merb-core-0.9.5 spec/public/controller/controllers/authentication.rb
merb-core-0.9.4 spec/public/controller/controllers/authentication.rb
thorero-core-0.9.4.6 spec/public/controller/controllers/authentication.rb