spec/kosher/algorithm_spec.rb in kosher-0.1.1 vs spec/kosher/algorithm_spec.rb in kosher-0.1.2
- old
+ new
@@ -19,9 +19,20 @@
request.locale = :us
request.batchify(asins)
request.get
end
+ describe ".new" do
+ it "raises an error if response is not valid" do
+ response = mock('Response')
+ response.stub!(:valid?).and_return(false)
+
+ expect do
+ Algorithm.new(response)
+ end.to raise_error ResponseNotValidError
+ end
+ end
+
describe "#items" do
it "should return found items" do
algorithm.items.count.should eql 19
algorithm.items.first.should be_a Item
end