Adding payments
This commit is contained in:
9
test/fixtures/payments.yml
vendored
Normal file
9
test/fixtures/payments.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
one:
|
||||
user:
|
||||
date: 2013-02-11
|
||||
|
||||
two:
|
||||
user:
|
||||
date: 2013-02-11
|
||||
49
test/functional/payments_controller_test.rb
Normal file
49
test/functional/payments_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PaymentsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@payment = payments(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:payments)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create payment" do
|
||||
assert_difference('Payment.count') do
|
||||
post :create, :payment => { :date => @payment.date }
|
||||
end
|
||||
|
||||
assert_redirected_to payment_path(assigns(:payment))
|
||||
end
|
||||
|
||||
test "should show payment" do
|
||||
get :show, :id => @payment
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, :id => @payment
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update payment" do
|
||||
put :update, :id => @payment, :payment => { :date => @payment.date }
|
||||
assert_redirected_to payment_path(assigns(:payment))
|
||||
end
|
||||
|
||||
test "should destroy payment" do
|
||||
assert_difference('Payment.count', -1) do
|
||||
delete :destroy, :id => @payment
|
||||
end
|
||||
|
||||
assert_redirected_to payments_path
|
||||
end
|
||||
end
|
||||
4
test/unit/helpers/payments_helper_test.rb
Normal file
4
test/unit/helpers/payments_helper_test.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PaymentsHelperTest < ActionView::TestCase
|
||||
end
|
||||
7
test/unit/payment_test.rb
Normal file
7
test/unit/payment_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PaymentTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user