Sha256: cd1f160a9b81f2af9ed96496bb1c95250f06b34d7ad91a14e08e6fcf871fd49c
Contents?: true
Size: 609 Bytes
Versions: 5
Compression:
Stored size: 609 Bytes
Contents
require 'model/spec_helper' require 'model/models/titled_model' require 'ronin/model/has_title' describe Model::HasTitle do subject { TitledModel } before(:all) do subject.auto_migrate! end it "should define a title property" do subject.properties.should be_named(:title) end it "should be able to find resources with similar titles" do subject.create!(:title => 'Foo one') subject.create!(:title => 'Foo bar two') models = subject.titled('Foo') models.length.should == 2 models[0].title.should == 'Foo one' models[1].title.should == 'Foo bar two' end end
Version data entries
5 entries across 5 versions & 1 rubygems