Introduced StockTaking. TODO: Dry up the stockit/stock_takings/deliveries controllers/views!
This commit is contained in:
parent
2bb4cdb9d6
commit
951d19db6a
30 changed files with 436 additions and 55 deletions
13
test/fixtures/stock_takings.yml
vendored
Normal file
13
test/fixtures/stock_takings.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
|
||||
one:
|
||||
date: 2009-02-12
|
||||
note: MyText
|
||||
created_by: 1
|
||||
created_at: 2009-02-12 14:53:06
|
||||
|
||||
two:
|
||||
date: 2009-02-12
|
||||
note: MyText
|
||||
created_by: 1
|
||||
created_at: 2009-02-12 14:53:06
|
||||
45
test/functional/stock_takings_controller_test.rb
Normal file
45
test/functional/stock_takings_controller_test.rb
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
require 'test_helper'
|
||||
|
||||
class StockTakingsControllerTest < ActionController::TestCase
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:stock_takings)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create stock_taking" do
|
||||
assert_difference('StockTaking.count') do
|
||||
post :create, :stock_taking => { }
|
||||
end
|
||||
|
||||
assert_redirected_to stock_taking_path(assigns(:stock_taking))
|
||||
end
|
||||
|
||||
test "should show stock_taking" do
|
||||
get :show, :id => stock_takings(:one).id
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, :id => stock_takings(:one).id
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update stock_taking" do
|
||||
put :update, :id => stock_takings(:one).id, :stock_taking => { }
|
||||
assert_redirected_to stock_taking_path(assigns(:stock_taking))
|
||||
end
|
||||
|
||||
test "should destroy stock_taking" do
|
||||
assert_difference('StockTaking.count', -1) do
|
||||
delete :destroy, :id => stock_takings(:one).id
|
||||
end
|
||||
|
||||
assert_redirected_to stock_takings_path
|
||||
end
|
||||
end
|
||||
8
test/unit/stock_taking_test.rb
Normal file
8
test/unit/stock_taking_test.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require 'test_helper'
|
||||
|
||||
class StockTakingTest < ActiveSupport::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue