initial commit
This commit is contained in:
0
whatforlunch.com/test/controllers/.keep
Normal file
0
whatforlunch.com/test/controllers/.keep
Normal 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
0
whatforlunch.com/test/fixtures/.keep
vendored
Normal file
17
whatforlunch.com/test/fixtures/recipes.yml
vendored
Normal file
17
whatforlunch.com/test/fixtures/recipes.yml
vendored
Normal 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
|
||||
0
whatforlunch.com/test/helpers/.keep
Normal file
0
whatforlunch.com/test/helpers/.keep
Normal file
4
whatforlunch.com/test/helpers/recipes_helper_test.rb
Normal file
4
whatforlunch.com/test/helpers/recipes_helper_test.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class RecipesHelperTest < ActionView::TestCase
|
||||
end
|
||||
0
whatforlunch.com/test/integration/.keep
Normal file
0
whatforlunch.com/test/integration/.keep
Normal file
0
whatforlunch.com/test/mailers/.keep
Normal file
0
whatforlunch.com/test/mailers/.keep
Normal file
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
|
||||
15
whatforlunch.com/test/test_helper.rb
Normal file
15
whatforlunch.com/test/test_helper.rb
Normal 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
|
||||
Reference in New Issue
Block a user