Sha256: 72f072b135a4a6ee13b69376d43783b1fa4e1ac2f4cc3c0a25ade2f2af44852a

Contents?: true

Size: 505 Bytes

Versions: 82

Compression:

Stored size: 505 Bytes

Contents

module CFoundryHelpers
  def random_str
    format("%x", rand(1000000))
  end

  def random_user
    "#{random_str}@cfoundry-spec.com"
  end

  def without_auth
    proxy = @client.proxy
    @client.logout
    @client.proxy = nil
    yield
  ensure
    @client.login(USER, PASSWORD)
    @client.proxy = proxy
  end

  def with_new_user
    @user = @client.register(random_user, "test")
    @client.proxy = @user.email
    yield
  ensure
    @client.proxy = nil
    @user.delete!
    @user = nil
  end
end

Version data entries

82 entries across 82 versions & 2 rubygems

Version Path
cfoundry-0.4.10 spec/helpers.rb
cfoundry-0.4.9 spec/helpers.rb
cfoundry-0.4.8 spec/helpers.rb
cfoundry-0.4.7 spec/helpers.rb
cfoundry-0.4.6 spec/helpers.rb
cfoundry-0.4.5 spec/helpers.rb
cfoundry-0.4.4 spec/helpers.rb
cfoundry-0.4.3 spec/helpers.rb
cfoundry-0.4.2 spec/helpers.rb
cfoundry-0.4.1 spec/helpers.rb
cfoundry-0.4.0 spec/helpers.rb
cfoundry-0.3.61 spec/helpers.rb
cfoundry-0.3.60 spec/helpers.rb
cfoundry-0.3.59 spec/helpers.rb
cfoundry-0.3.58 spec/helpers.rb
cfoundry-0.3.57 spec/helpers.rb
cfoundry-0.3.56 spec/helpers.rb
cfoundry-0.3.55 spec/helpers.rb
cfoundry-0.3.54 spec/helpers.rb
cfoundry-0.3.53 spec/helpers.rb