Sha256: eb9c3139c933df33aca4a72dab377ccfa67ab73df7aec1639f1c7d7a9c632fd3

Contents?: true

Size: 761 Bytes

Versions: 6

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'

describe ZendeskAPI::Search do
  context ".new" do
    context "when given an existing class" do
      it "should return the correct class" do
        ZendeskAPI::Search.new(nil, { "result_type" => "user" }).should be_instance_of(ZendeskAPI::User)
      end
    end

    context "when given a nonexistant class" do
      it "should return an object of the type Search::Result" do
        ZendeskAPI::Search.new(nil, { "result_type" => "blah" }).should be_instance_of(ZendeskAPI::Search::Result)
      end
    end

    context "when not given anything" do
      it "should return an object of the type Search::Result" do
        ZendeskAPI::Search.new(nil, {}).should be_instance_of(ZendeskAPI::Search::Result)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
zendesk_api-0.1.11 spec/search_spec.rb
zendesk_api-0.1.10 spec/search_spec.rb
zendesk_api-0.1.9 spec/search_spec.rb
zendesk_api-0.1.8 spec/search_spec.rb
zendesk_api-0.1.7 spec/search_spec.rb
zendesk_api-0.1.6 spec/search_spec.rb