Sha256: b89466cad0911127d5b4c7cc286e1e7b84f5d2f7e38902324f5bb071fa13b96a

Contents?: true

Size: 885 Bytes

Versions: 3

Compression:

Stored size: 885 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Authentication" do
  context Istat::Frames::AuthenticationRequest do
    it "should be possible to generate a correct password frame" do
      frame = Istat::Frames::AuthenticationRequest.new("test")
      frame.to_s.should == "test"
    end
  end
  
  context Istat::Frames::AuthenticationResponse do
    it "should be possible to parse the authentication response" do
      xml = %{<?xml version="1.0" encoding="UTF-8"?><isr ready="1"></isr>}
      frame = Istat::Frames::AuthenticationResponse.new(xml)
      frame.ready?.should be_true
      frame.rejected?.should be_false
      xml = %{<?xml version="1.0" encoding="UTF-8"?><isr athrej="1"></isr>}
      frame = Istat::Frames::AuthenticationResponse.new(xml)
      frame.rejected?.should be_true
      frame.ready?.should be_false
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
istat-0.0.3 spec/frames/authentication_spec.rb
istat-0.0.2 spec/frames/authentication_spec.rb
istat-0.0.1 spec/frames/authentication_spec.rb