Sha256: c5961304e7a0980f707b6f3d5486eaf6f70da4eaa9ad3e4cc9698a7a47d0fa7f
Contents?: true
Size: 862 Bytes
Versions: 7
Compression:
Stored size: 862 Bytes
Contents
require "spec_helper" describe Shamu::Entities::OpaqueId do describe ".to_model_id" do it "gets the encoded id for a valid opaque id" do # Patients::Patient[1] expect( Shamu::Entities::OpaqueId.to_model_id( "::UGF0aWVudHM6OlBhdGllbnRbMV0=" ) ).to eq 1 end it "is int for raw ids" do expect( Shamu::Entities::OpaqueId.to_model_id( "23" ) ).to eq 23 end end describe ".opaque_id?" do it "recognizes encoded ids" do expect( Shamu::Entities::OpaqueId.opaque_id?( "::UGF0aWVudHM6OlBhdGllbnRbMV0=" ) ).to be_truthy end it "does not recognize raw numbers" do expect( Shamu::Entities::OpaqueId.opaque_id?( "123" ) ).to be_falsy end it "does not recognize base64 encoded" do expect( Shamu::Entities::OpaqueId.opaque_id?( "UGF0aWVudHM6OlBhdGllbnRbMV0=" ) ).to be_falsy end end end
Version data entries
7 entries across 7 versions & 1 rubygems