Sha256: fb3570404005dbb68ecfa523e4612ef026ff40932919ab953ddf3573d9209b70

Contents?: true

Size: 793 Bytes

Versions: 22

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

require 'certmeister/policy/response'

describe Certmeister::Policy::Response do

  describe "on error" do

    it "is not authenticated" do
      response = Certmeister::Policy::Response.new(nil, "you smell wrong")
      expect(response).to_not be_authenticated
    end

    it "provides the error" do
      response = Certmeister::Policy::Response.new(nil, "you smell wrong")
      expect(response.error).to eql "you smell wrong"
    end

  end

  describe "on success" do

    it "is authenticated" do
      response = Certmeister::Policy::Response.new(true, nil)
      expect(response).to be_authenticated
    end

    it "provides no error" do
      response = Certmeister::Policy::Response.new(true, nil)
      expect(response.error).to be_nil
    end

  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
certmeister-2.3.2 spec/certmeister/policy/response_spec.rb
certmeister-2.3.1 spec/certmeister/policy/response_spec.rb
certmeister-2.3.0 spec/certmeister/policy/response_spec.rb
certmeister-2.2.0 spec/certmeister/policy/response_spec.rb
certmeister-2.1.0 spec/certmeister/policy/response_spec.rb
certmeister-2.0.0 spec/certmeister/policy/response_spec.rb
certmeister-1.2.1 spec/certmeister/policy/response_spec.rb
certmeister-1.2.0 spec/certmeister/policy/response_spec.rb
certmeister-1.1.0 spec/certmeister/policy/response_spec.rb
certmeister-1.0.1 spec/certmeister/policy/response_spec.rb
certmeister-1.0.0 spec/certmeister/policy/response_spec.rb
certmeister-0.4.1 spec/certmeister/policy/response_spec.rb
certmeister-0.4.0 spec/certmeister/policy/response_spec.rb
certmeister-0.3.2 spec/certmeister/policy/response_spec.rb
certmeister-0.3.1 spec/certmeister/policy/response_spec.rb
certmeister-0.3.0 spec/certmeister/policy/response_spec.rb
certmeister-0.2.3 spec/certmeister/policy/response_spec.rb
certmeister-0.2.1 spec/certmeister/policy/response_spec.rb
certmeister-0.2.0 spec/certmeister/policy/response_spec.rb
certmeister-0.1.0 spec/certmeister/policy/response_spec.rb