Created
October 23, 2011 01:28
-
-
Save d11wtq/1306732 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failures: | |
1) Acquisto::ReflectiveRoutes with a model containing a 1:n relationship generates a route to fetch the child collection | |
Failure/Error: model.finalize | |
NameError: | |
Cannot find the child_model Invoice for Customer in invoices | |
# ./spec/unit/reflective_routes_spec.rb:11:in `block (2 levels) in <top (required)>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context "with a model containing a 1:n relationship" do | |
let!(:invoice_model) do | |
Class.new do | |
def self.name | |
"Invoice" | |
end | |
include DataMapper::Resource | |
property :id, DataMapper::Property::Serial | |
property :price, DataMapper::Property::Integer | |
belongs_to :customer | |
end | |
end | |
let!(:model) do | |
Class.new do | |
def self.name | |
"Customer" | |
end | |
include DataMapper::Resource | |
property :id, DataMapper::Property::Serial | |
property :name, DataMapper::Property::String | |
has n, :invoices | |
end | |
end | |
let(:customer) { model.create(:name => "Bob") } | |
let(:invoice) { model.invoices.create(:price => 20) } | |
# ... examples follow ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment