Skip to content

Commit

Permalink
add spec for couchrest#167
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Hecking committed Jun 27, 2013
1 parent a22d62b commit 92096b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/unit/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -564,4 +564,19 @@ def set_name; self.name = "foobar"; end
end
end

describe "model inheritance" do
context "multiple models with same base class" do
it "should not overwrite property definitions of the same name in different models" do
class MyBase < CouchRest::Model::Base; end
class MyModelA < MyBase
property :prop, Time
end
class MyModelB < MyBase
property :prop, Integer
end
MyModelA.new(:prop => Time.now).prop.class.should eq Time
end
end
end

end

0 comments on commit 92096b7

Please sign in to comment.