Skip to content

Commit 8824f53

Browse files
committed
add search spec
1 parent 0e63319 commit 8824f53

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/search_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'spec_helper'
2+
3+
describe ZendeskAPI::Search do
4+
context ".new" do
5+
context "when given an existing class" do
6+
it "should return the correct class" do
7+
ZendeskAPI::Search.new(nil, { "result_type" => "user" }).should be_instance_of(ZendeskAPI::User)
8+
end
9+
end
10+
11+
context "when given a nonexistant class" do
12+
it "should return an object of the type Search::Result" do
13+
ZendeskAPI::Search.new(nil, { "result_type" => "blah" }).should be_instance_of(ZendeskAPI::Search::Result)
14+
end
15+
end
16+
17+
context "when not given anything" do
18+
it "should return an object of the type Search::Result" do
19+
ZendeskAPI::Search.new(nil, {}).should be_instance_of(ZendeskAPI::Search::Result)
20+
end
21+
end
22+
end
23+
end

0 commit comments

Comments
 (0)