initial commit
This commit is contained in:
0
whatforlunch.com/test/models/.keep
Normal file
0
whatforlunch.com/test/models/.keep
Normal file
21
whatforlunch.com/test/models/recipe_test.rb
Normal file
21
whatforlunch.com/test/models/recipe_test.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'test_helper'
|
||||
|
||||
class RecipeTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
|
||||
test "scraping should get all possible information" do
|
||||
r = Recipe.new
|
||||
r.original_url = "http://www.coolinarika.com/recept/burek-za-obraza/"
|
||||
r.save!
|
||||
r.scrape!
|
||||
r.save!
|
||||
|
||||
assert_equal r.ingredients.length, 10
|
||||
assert_not_nil r.name
|
||||
assert_equal "Srednje zahtjevno", r.duration.to_s
|
||||
assert r.ordinal >= 1, "Ordinal is not working!"
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user