2011-05-24 11:12:38 +02:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
|
|
|
|
|
|
describe "Document#attributes" do
|
|
|
|
it "returns a hash with all attributes" do
|
|
|
|
class FooDoc
|
2011-05-24 14:41:09 +02:00
|
|
|
include Polecat::Document
|
2011-05-24 11:12:38 +02:00
|
|
|
|
|
|
|
field :bar
|
|
|
|
end
|
|
|
|
d = FooDoc.new
|
2011-05-24 14:41:09 +02:00
|
|
|
d.attributes.should == {:bar => Polecat::Document::OPTIONS}
|
2011-05-24 11:12:38 +02:00
|
|
|
end
|
|
|
|
end
|