initial commit

This commit is contained in:
Senad Uka
2017-09-24 10:12:44 +02:00
parent 05c9ffc3a3
commit 4a3349e500
125 changed files with 10992 additions and 0 deletions

View File

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class RecipesControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

0
whatforlunch.com/test/fixtures/.keep vendored Normal file
View File

View File

@@ -0,0 +1,17 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
duration: MyString
ingredients: MyString
process: MyString
picture_url: MyString
original_url: MyString
two:
name: MyString
duration: MyString
ingredients: MyString
process: MyString
picture_url: MyString
original_url: MyString

View File

View File

@@ -0,0 +1,4 @@
require 'test_helper'
class RecipesHelperTest < ActionView::TestCase
end

View File

View File

View File

View 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

View File

@@ -0,0 +1,15 @@
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end