[#4177] Hooked up the create action for contracts.

This commit is contained in:
Eric Davis
2010-06-21 14:00:04 -07:00
parent 0911ab08d3
commit a77fa40207
5 changed files with 33 additions and 2 deletions
+26
View File
@@ -15,4 +15,30 @@ class ContractsNewTest < ActionController::IntegrationTest
assert_select "form#new_contract"
end
should "create a new contract" do
@account_executive = User.generate!
visit_contracts_for_project(@project)
click_link 'New Contract'
assert_response :success
fill_in "Name", :with => 'A New Contract'
select @account_executive.name, :from => "Account Executive"
fill_in "Start", :with => '2010-01-01'
fill_in "End Date", :with => '2010-12-31'
select "Net 30", :from => "Payment Terms"
click_button "Create Contract"
assert_response :success
assert_template 'contracts/show'
@contract = Contract.last
assert_equal "A New Contract", @contract.name
assert_equal @account_executive, @contract.account_executive
assert_equal '2010-01-01', @contract.start_date.to_s
assert_equal '2010-12-31', @contract.end_date.to_s
assert_equal 'net_30', @contract.payment_terms
end
end