~c2c-oerpscenario/oerpscenario/stable-6.0

« back to all changes in this revision

Viewing changes to features/account/step_definitions/account_bank_statement_steps.rb

  • Committer: Joël Grand-Guillaume
  • Date: 2010-03-26 11:30:57 UTC
  • mfrom: (30.1.75 OERPScenario)
  • Revision ID: joel.grandguillaume@camptocamp.com-20100326113057-w6jb16avnxkf2ize
[MRG] From trunk branch. This is about releasing the 0.5 version of OERPScenario.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#
20
20
##############################################################################
21
21
 
22
 
# # @invoice = false
23
 
# Before do
24
 
#     # Initiate vars used to stored object used trought the tests
25
 
#     @partner = false
26
 
#     @address = false
27
 
#     @account = false
28
 
#     @prod = false
29
 
#     @currency = false
30
 
#     @company = false
31
 
#     @wizard  = false
32
 
#     @journal = false
33
 
#     @statement = false
34
 
# end
35
 
36
 
 
37
22
##############################################################################
38
 
#           Scenario: make_and_validate_payments_with_bank_statement
 
23
#           Scenario: Reconcile a confirmed invoice using a bank statement
39
24
##############################################################################
40
25
Given /^I create a new bank statement called (\w+) with a (\w+) account journal$/ do |statement_name,currency|
41
26
  @statement=AccountBankStatement.create_statement_with_currency({:currency_code => currency,:name => statement_name})
55
40
end
56
41
 
57
42
##############################################################################
58
 
# And /^I import on the (.*), the following invoice \(order matters\) : (\w+)$/
 
43
#           Scenario: Validate rollback entries when confirming a bank statement
 
44
##############################################################################
59
45
And /^I import on the (.*), the following invoice \(order matters\) : (.*)$/ do |date,invoices_name|
60
46
    invoices=[]
61
47
    invoices_name.split(',').each do |inv_name|
72
58
  @statement.call('button_confirm',[@statement.id])
73
59
end
74
60
 
75
 
 
76
61
##############################################################################
77
62
And /^confirm the statement and see it confirmed$/ do
78
63
  # @statement.wkf_action('button_confirm')
79
64
  @statement.call('button_confirm',[@statement.id])
80
 
  @statement=AccountBankStatement.find(@statement.id)
 
65
  @statement=AccountBankStatement.find(@statement.id, :fields=>['id', 'state', 'line_ids'])
81
66
  @statement.state.should == 'confirm'
82
67
end
 
68
 
83
69
##############################################################################
84
 
 
85
70
Given /^I take the bank statement called (\w+)$/ do |bankStatement_name|
86
71
  @statement=AccountBankStatement.find(:first,:domain=>[['name','=',bankStatement_name]])
87
72
  @statement.should be_true
112
97
 
113
98
##############################################################################
114
99
When /^no entries should be created by the bank statement$/ do
115
 
  accountmovelines=AccountMoveLine.find(:all,:domain=>[['statement_id','=',@statement.id]])
116
 
  accountmovelines.should == []
 
100
  accountmovelines=AccountMoveLine.find(:all,:domain=>[['statement_id','=',@statement.id]],:fields=>['id'])
 
101
  accountmovelines.should_be_empty
117
102
end
118
103
 
119
104