remove tests (since we use rspec)
This commit is contained in:
parent
f221af4992
commit
13e5d26885
20 changed files with 0 additions and 343 deletions
9
test/fixtures/article_categories.yml
vendored
9
test/fixtures/article_categories.yml
vendored
|
@ -1,9 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
fruits:
|
|
||||||
name: Fruits
|
|
||||||
description: fruits and only fruits
|
|
||||||
vegi:
|
|
||||||
name: Vegetables
|
|
||||||
other:
|
|
||||||
name: Other stuff
|
|
||||||
|
|
38
test/fixtures/article_prices.yml
vendored
38
test/fixtures/article_prices.yml
vendored
|
@ -1,38 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
banana1:
|
|
||||||
article: banana
|
|
||||||
price: 1.45
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 18
|
|
||||||
created_at: <%= Time.now.to_s(:db) %>
|
|
||||||
|
|
||||||
banana2:
|
|
||||||
article: banana
|
|
||||||
price: 1.35
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 18
|
|
||||||
created_at: <%= Time.now.to_s(:db) %>
|
|
||||||
|
|
||||||
kiwi1:
|
|
||||||
article: kiwi
|
|
||||||
price: 1.11
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 10
|
|
||||||
created_at: <%= Time.now.to_s(:db) %>
|
|
||||||
|
|
||||||
potatoe1:
|
|
||||||
article: potatoe
|
|
||||||
price: 1.33
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 25
|
|
||||||
created_at: <%= Time.now.to_s(:db) %>
|
|
||||||
|
|
||||||
applejuice1:
|
|
||||||
article: applejuice
|
|
||||||
price: 1.15
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 1
|
|
||||||
deposit: 0.15
|
|
||||||
created_at: <%= Time.now.to_s(:db) %>
|
|
||||||
|
|
79
test/fixtures/articles.yml
vendored
79
test/fixtures/articles.yml
vendored
|
@ -1,79 +0,0 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: articles
|
|
||||||
#
|
|
||||||
# id :integer(4) not null, primary key
|
|
||||||
# name :string(255) default(""), not null
|
|
||||||
# supplier_id :integer(4) default(0), not null
|
|
||||||
# article_category_id :integer(4) default(0), not null
|
|
||||||
# unit :string(255) default(""), not null
|
|
||||||
# note :string(255)
|
|
||||||
# availability :boolean(1) default(TRUE), not null
|
|
||||||
# manufacturer :string(255)
|
|
||||||
# origin :string(255)
|
|
||||||
# shared_updated_on :datetime
|
|
||||||
# price :decimal(8, 2)
|
|
||||||
# tax :float
|
|
||||||
# deposit :decimal(8, 2) default(0.0)
|
|
||||||
# unit_quantity :integer(4) default(1), not null
|
|
||||||
# order_number :string(255)
|
|
||||||
# created_at :datetime
|
|
||||||
# updated_at :datetime
|
|
||||||
# deleted_at :datetime
|
|
||||||
# type :string(255)
|
|
||||||
# quantity :integer(4) default(0)
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
banana:
|
|
||||||
supplier: terra
|
|
||||||
name: Banana
|
|
||||||
article_category: fruits
|
|
||||||
unit: KG
|
|
||||||
availability: true
|
|
||||||
note: delicious
|
|
||||||
origin: EC
|
|
||||||
price: 1.45
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 18
|
|
||||||
order_number: 123456
|
|
||||||
|
|
||||||
kiwi:
|
|
||||||
supplier: terra
|
|
||||||
name: Kiwi
|
|
||||||
article_category: fruits
|
|
||||||
unit: 500g
|
|
||||||
availability: true
|
|
||||||
origin: IT
|
|
||||||
price: 1.11
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 10
|
|
||||||
order_number: 123457
|
|
||||||
|
|
||||||
potatoe:
|
|
||||||
supplier: terra
|
|
||||||
name: Potatoe
|
|
||||||
article_category: vegi
|
|
||||||
unit: 500g
|
|
||||||
availability: true
|
|
||||||
origin: REG
|
|
||||||
price: 1.33
|
|
||||||
tax: 7.0
|
|
||||||
unit_quantity: 25
|
|
||||||
order_number: 123458
|
|
||||||
|
|
||||||
applejuice:
|
|
||||||
type: StockArticle
|
|
||||||
supplier: terra
|
|
||||||
name: Apple-juice
|
|
||||||
article_category: other
|
|
||||||
unit: 1L
|
|
||||||
price: 1.33
|
|
||||||
tax: 7.0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
3
test/fixtures/assignments.yml
vendored
3
test/fixtures/assignments.yml
vendored
|
@ -1,3 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
14
test/fixtures/financial_transactions.yml
vendored
14
test/fixtures/financial_transactions.yml
vendored
|
@ -1,14 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
bananas1:
|
|
||||||
ordergroup: bananas
|
|
||||||
amount: 0.00
|
|
||||||
note: "Deposit for 3 people: 15,-€"
|
|
||||||
user: admin
|
|
||||||
created_on: <%= 2.weeks.ago.to_s(:db) %>
|
|
||||||
|
|
||||||
bananas2:
|
|
||||||
ordergroup: bananas
|
|
||||||
amount: 100.00
|
|
||||||
note: Paying in from <%= 1.weeks.ago.strftime("%d.%m.%Y") %>
|
|
||||||
created_on: <%= 1.weeks.ago.to_s(:db) %>
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
19
test/fixtures/groups.yml
vendored
19
test/fixtures/groups.yml
vendored
|
@ -1,19 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
admins:
|
|
||||||
type: Workgroup
|
|
||||||
name: Administrators
|
|
||||||
description: System administrators.
|
|
||||||
created_on: <%= 5.weeks.ago.to_s(:db) %>
|
|
||||||
role_admin: true
|
|
||||||
role_suppliers: true
|
|
||||||
role_article_meta: true
|
|
||||||
role_finance: true
|
|
||||||
role_orders: true
|
|
||||||
bananas:
|
|
||||||
type: Ordergroup
|
|
||||||
name: Banangroup
|
|
||||||
created_on: <%= 4.weeks.ago.to_s(:db) %>
|
|
||||||
account_balance: 100.00
|
|
||||||
contact_person: Tim
|
|
||||||
contact_phone: 030 123132456
|
|
||||||
contact_address: Waldermarstrasse 43, 10988 Berlin
|
|
9
test/fixtures/memberships.yml
vendored
9
test/fixtures/memberships.yml
vendored
|
@ -1,9 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
first:
|
|
||||||
group: admins
|
|
||||||
user: admin
|
|
||||||
second:
|
|
||||||
group: bananas
|
|
||||||
user: test
|
|
||||||
|
|
||||||
|
|
4
test/fixtures/messages.yml
vendored
4
test/fixtures/messages.yml
vendored
|
@ -1,4 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
test/fixtures/order_comments.yml
vendored
2
test/fixtures/order_comments.yml
vendored
|
@ -1,2 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
2
test/fixtures/orders.yml
vendored
2
test/fixtures/orders.yml
vendored
|
@ -1,2 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
13
test/fixtures/pages.yml
vendored
13
test/fixtures/pages.yml
vendored
|
@ -1,13 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
one:
|
|
||||||
title: MyString
|
|
||||||
body: MyText
|
|
||||||
permalink: MyString
|
|
||||||
|
|
||||||
two:
|
|
||||||
title: MyString
|
|
||||||
body: MyText
|
|
||||||
permalink: MyString
|
|
||||||
|
|
||||||
|
|
2
test/fixtures/stock_changes.yml
vendored
2
test/fixtures/stock_changes.yml
vendored
|
@ -1,2 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
3
test/fixtures/stock_takings.yml
vendored
3
test/fixtures/stock_takings.yml
vendored
|
@ -1,3 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
36
test/fixtures/suppliers.yml
vendored
36
test/fixtures/suppliers.yml
vendored
|
@ -1,36 +0,0 @@
|
||||||
# == Schema Information
|
|
||||||
#
|
|
||||||
# Table name: suppliers
|
|
||||||
#
|
|
||||||
# id :integer(4) not null, primary key
|
|
||||||
# name :string(255) not null
|
|
||||||
# address :string(255) not null
|
|
||||||
# phone :string(255) not null
|
|
||||||
# phone2 :string(255)
|
|
||||||
# fax :string(255)
|
|
||||||
# email :string(255)
|
|
||||||
# url :string(255)
|
|
||||||
# delivery_days :string(255)
|
|
||||||
# note :string(255)
|
|
||||||
# created_on :datetime
|
|
||||||
# updated_on :datetime
|
|
||||||
# lists :string(255)
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
terra:
|
|
||||||
name: Terra
|
|
||||||
address: berlin bio
|
|
||||||
phone: 0123-555555
|
|
||||||
phone2: 01234-7878787
|
|
||||||
fax: 01324-343444
|
|
||||||
email: terra@terra.com
|
|
||||||
url: www.terra-natur.de
|
|
||||||
contact_person: Harry
|
|
||||||
customer_number: 123478
|
|
||||||
delivery_days: tuesday
|
|
||||||
order_howto: call or send email/fax
|
|
||||||
note:
|
|
||||||
Terra possibly delivers also on other days than tuesday. Don't
|
|
||||||
hesitate to ask for it.
|
|
||||||
min_order_quantity: 80,-€ (gross)
|
|
4
test/fixtures/tasks.yml
vendored
4
test/fixtures/tasks.yml
vendored
|
@ -1,4 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
|
|
||||||
|
|
||||||
|
|
18
test/fixtures/users.yml
vendored
18
test/fixtures/users.yml
vendored
|
@ -1,18 +0,0 @@
|
||||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
|
||||||
admin:
|
|
||||||
nick: admin
|
|
||||||
first_name: Anton
|
|
||||||
last_name: Admininistrator
|
|
||||||
email: admin@foo.test
|
|
||||||
password_hash: a3c77e64311ad37161e582b28737d1e420962538
|
|
||||||
password_salt: LNpP/lca
|
|
||||||
created_on: <%= 1.day.ago.to_s(:db) %>
|
|
||||||
test:
|
|
||||||
nick: test
|
|
||||||
first_name: Tim
|
|
||||||
last_name: Tester
|
|
||||||
email: test@foo.test
|
|
||||||
password_hash: 5549cd54032a72435037893b02d95ebef13cdc57
|
|
||||||
password_salt: DxnbIF1h
|
|
||||||
created_on: <%= Time.now.to_s(:db) %>
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
ENV["RAILS_ENV"] = "test"
|
|
||||||
require File.expand_path('../../config/environment', __FILE__)
|
|
||||||
require 'rails/test_help'
|
|
||||||
|
|
||||||
class ActiveSupport::TestCase
|
|
||||||
# Setup all fixtures in test/fixtures/*.(yml|csv) 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
|
|
||||||
|
|
||||||
def login(nick='admin', pass='secret')
|
|
||||||
open_session do |session|
|
|
||||||
session.post '/f/login', nick: nick, password: pass
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def logout
|
|
||||||
open_session do |session|
|
|
||||||
session.post '/f/logout'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,23 +0,0 @@
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
|
||||||
|
|
||||||
class SupplierTest < ActiveSupport::TestCase
|
|
||||||
fixtures :suppliers
|
|
||||||
|
|
||||||
def setup
|
|
||||||
@supplier = Supplier.find_by_name("Terra")
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'read' do
|
|
||||||
assert_equal "Terra", @supplier.name
|
|
||||||
assert_equal "www.terra-natur.de", @supplier.url
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'update' do
|
|
||||||
assert_equal "tuesday", @supplier.delivery_days
|
|
||||||
@supplier.delivery_days = 'wednesday'
|
|
||||||
assert @supplier.save, @supplier.errors.full_messages.join("; ")
|
|
||||||
@supplier.reload
|
|
||||||
assert_equal 'wednesday', @supplier.delivery_days
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
require File.dirname(__FILE__) + '/../test_helper'
|
|
||||||
|
|
||||||
class UserTest < ActiveSupport::TestCase
|
|
||||||
fixtures :users
|
|
||||||
|
|
||||||
def setup
|
|
||||||
@admin = users(:admin)
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'read_user' do
|
|
||||||
assert_kind_of User, @admin
|
|
||||||
assert_equal "Anton", @admin.first_name
|
|
||||||
assert_equal "Admininistrator", @admin.last_name
|
|
||||||
assert_equal "admin@foo.test", @admin.email
|
|
||||||
assert @admin.role_admin?
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'create_and_read_password' do
|
|
||||||
@admin.password = "some_secret"
|
|
||||||
@admin.password_confirmation = @admin.password
|
|
||||||
assert @admin.valid?
|
|
||||||
assert @admin.has_password("some_secret")
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'invalid_password' do
|
|
||||||
@admin.password = "foo"
|
|
||||||
@admin.password_confirmation = @admin.password
|
|
||||||
assert @admin.invalid?
|
|
||||||
assert_equal [I18n.t('activemodel.errors.messages.too_short', count: 5)], @admin.errors[:password]
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'password_not_match' do
|
|
||||||
@admin.password = "foobar"
|
|
||||||
@admin.password_confirmation = "foobor"
|
|
||||||
@admin.save
|
|
||||||
assert_equal [I18n.t('activemodel.errors.messages.confirmation')], @admin.errors[:password]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
Loading…
Reference in a new issue