spec/integration_spec.rb in freebase-importers-0.0.2 vs spec/integration_spec.rb in freebase-importers-0.0.3
- old
+ new
@@ -12,10 +12,19 @@
it "should have a name" do
expect(book.name).to match /\w+/
end
end
+ describe FreebaseImporters::President do
+ let (:president) { FreebaseImporters::President.first }
+ it "should have attributes" do
+ [:name, :id, :height_meters].each do |attr|
+ expect(president.send(attr)).not_to be_nil
+ end
+ end
+ end
+
describe FreebaseImporters::Car do
let(:car) { FreebaseImporters::Car.first }
it "should have images and thumbnails" do
expect(car.thumbnail_urls).not_to be_empty
expect(car.image_urls).not_to be_empty
@@ -23,10 +32,10 @@
describe :endless do
it "should return a second page of results" do
counter = 0
images = []
- FreebaseImporters::Car.endless do |car|
+ FreebaseImporters::Car.endless(0) do |car|
counter += 1
images << car.image_url if counter < 50
if counter > 120
expect(images).not_to include(car.image_url)
break
\ No newline at end of file