Adding tests to some expected behaviors
This commit is contained in:
parent
e3386a45f4
commit
1a551b54eb
5 changed files with 44 additions and 32 deletions
6
spec/fixtures/more/client.rb
vendored
Normal file
6
spec/fixtures/more/client.rb
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
class Client < CouchRest::Model::Base
|
||||
use_database DB
|
||||
|
||||
property :name
|
||||
property :tax_code
|
||||
end
|
9
spec/fixtures/more/sale_entry.rb
vendored
Normal file
9
spec/fixtures/more/sale_entry.rb
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
class SaleEntry < CouchRest::Model::Base
|
||||
use_database DB
|
||||
|
||||
property :description
|
||||
property :price
|
||||
|
||||
view_by :description
|
||||
|
||||
end
|
13
spec/fixtures/more/sale_invoice.rb
vendored
Normal file
13
spec/fixtures/more/sale_invoice.rb
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
require File.join(FIXTURE_PATH, 'more', 'client')
|
||||
require File.join(FIXTURE_PATH, 'more', 'sale_entry')
|
||||
class SaleInvoice < CouchRest::Model::Base
|
||||
use_database DB
|
||||
|
||||
belongs_to :client
|
||||
belongs_to :alternate_client, :class_name => 'Client', :foreign_key => 'alt_client_id'
|
||||
|
||||
collection_of :entries, :class_name => 'SaleEntry'
|
||||
|
||||
property :date, Date
|
||||
property :price, Integer
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue