spec/api_spec.rb in cloudinary-1.1.4 vs spec/api_spec.rb in cloudinary-1.1.5
- old
+ new
@@ -68,15 +68,14 @@
expect(resources.map{|resource| resource["tags"]}.flatten).to include(TEST_TAG, @timestamp_tag)
expect(resources.map{|resource| resource["context"]}).to include({"custom" => {"key" => "value"}})
end
it "should allow listing resources by start date", :start_at => true do
- sleep(2)
- start_at = Time.now.to_s
- sleep(2)
- response = Cloudinary::Uploader.upload("spec/logo.png")
+ sleep(1)
+ response = Cloudinary::Uploader.upload("spec/logo.png", :tags => TEST_TAG)
+ start_at = Time.parse( response["created_at"]) - 0.5
resources = @api.resources(:type=>"upload", :start_at=>start_at, :direction => "asc")["resources"]
- expect(resources.map{|resource| resource["public_id"]}) == [response["public_id"]]
+ expect(resources.map{|resource| resource["public_id"]}).to eq([response["public_id"]])
end
it "should allow listing resources in both directions" do
asc_resources = @api.resources_by_tag(@timestamp_tag, :type=>"upload", :direction => "asc")["resources"]
desc_resources = @api.resources_by_tag(@timestamp_tag, :type=>"upload", :direction => "desc")["resources"]