Sha256: b302876364a28e94ed265c769c7110e951b1a3fd308912bbf67e617fd3a0d075

Contents?: true

Size: 756 Bytes

Versions: 9

Compression:

Stored size: 756 Bytes

Contents

require "spec_helper"

RSpec.describe Digicert::CLI::FilterBuilder do
  describe ".build" do
    context "normal filter options" do
      it "builds filters only with valid attributes" do
        options = { status: "pending", invalid: "invalid", search: "" }
        filters = Digicert::CLI::FilterBuilder.build(options)

        expect(filters).to eq("status" => "pending")
      end
    end

    context "filter values as an array" do
      it "builds the valid filters properly" do
        options = { status: "pending,active", search: "s" }
        filters = Digicert::CLI::FilterBuilder.build(options)

        expect(filters).to eq(
          "status" => { "0" => "pending", "1" => "active" }, "search" => "s",
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
digicert-cli-1.0.0 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.5.2 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.5.1 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.5.0 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.4.2 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.4.1 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.4.0 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.3.0 spec/digicert/cli/filter_builder_spec.rb
digicert-cli-0.2.0 spec/digicert/cli/filter_builder_spec.rb