Files
redmine_contracts/test/integration/contracts_edit_test.rb
Eric Davis a2b810a4d8 [#4410] Replace Payment Terms with an Enumeration
Instead of using a hard coded value for Payment Terms, they will use
Redmine's Enumeration table.  This provides an admin gui to managing
the value as well as ordering them.
2010-08-12 09:26:09 -07:00

39 lines
1.1 KiB
Ruby

require 'test_helper'
class ContractsEditTest < ActionController::IntegrationTest
include Redmine::I18n
def setup
@project = Project.generate!(:identifier => 'main')
@account_executive = User.generate!
@role = Role.generate!
User.add_to_project(@account_executive, @project, @role)
@contract = Contract.generate!(:project => @project, :name => 'A Contract', :account_executive => @account_executive)
end
should "allow any user to edit the contract" do
visit_contracts_for_project(@project)
click_link @contract.id
assert_response :success
click_link 'Update'
assert_response :success
assert_template 'contracts/edit'
assert_select "h2", :text => /#{@contract.name}/
assert_select "form#edit_contract_#{@contract.id}.contract" do
assert_select "input[value=?]", /#{@contract.name}/
assert_select "select#contract_payment_term_id"
end
fill_in "Name", :with => 'An updated name'
click_button "Save Contract"
assert_response :success
assert_template 'contracts/show'
assert_equal "An updated name", @contract.reload.name
end
end