Sha256: 38531b2aa59435be5a0b46516e310994174e859569b12cd63fd3ab4d409b2867

Contents?: true

Size: 987 Bytes

Versions: 2

Compression:

Stored size: 987 Bytes

Contents

require "spec_helper"

module Lumberg
  describe Cpanel::Password do
    let(:server) { Whm::Server.new(:host => @whm_host, :hash => @whm_hash) }
    let(:api_username) { "lumberg" }
    let(:password) do
      described_class.new(
        :server       => server,
        :api_username => api_username
      )
    end

    let(:random_password) { "realtopsecretpassword" }

    describe "#modify" do
      use_vcr_cassette "cpanel/password/modify"

      it "sets a new password for account" do
        result = password.modify({ :old => '12345', :new => random_password })
        result[:params][:data][0].should be_a(Hash)
      end
    end

    describe "#digest_authentication" do
      use_vcr_cassette "cpanel/password/digest_authentication"

      it "enables digest authentication for account" do
        result = password.digest_authentication({ :password => random_password, :enable => true })
        result[:params][:data][0].should be_a(Hash)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lumberg-2.0.0.pre4 spec/cpanel/password_spec.rb
lumberg-2.0.0.pre3 spec/cpanel/password_spec.rb