Adding payments

This commit is contained in:
2013-02-12 01:58:17 -07:00
parent 3fb774d057
commit ed75ea0e90
29 changed files with 447 additions and 60 deletions

9
test/fixtures/payments.yml vendored Normal file
View 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

View 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

View File

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

View File

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