Sha256: 53bb21dd89395c4a4c293f56adf829b900af15d27f2872a0bd649037895f7741

Contents?: true

Size: 701 Bytes

Versions: 9

Compression:

Stored size: 701 Bytes

Contents

require 'model/spec_helper'
require 'model/models/titled_model'

require 'ronin/model/has_title'

describe Model::HasTitle do
  subject { TitledModel }

  before(:all) { subject.auto_migrate! }

  it "should include Ronin::Model" do
    subject.ancestors.should include(Model)
  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')

    resources = subject.titled('Foo')

    resources.length.should == 2
    resources[0].title.should == 'Foo one'
    resources[1].title.should == 'Foo bar two'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ronin-1.3.0 spec/model/has_title_spec.rb
ronin-1.2.0 spec/model/has_title_spec.rb
ronin-1.1.0 spec/model/has_title_spec.rb
ronin-1.1.0.rc3 spec/model/has_title_spec.rb
ronin-1.1.0.rc2 spec/model/has_title_spec.rb
ronin-1.1.0.rc1 spec/model/has_title_spec.rb
ronin-1.0.0 spec/model/has_title_spec.rb
ronin-1.0.0.rc3 spec/model/has_title_spec.rb
ronin-1.0.0.rc2 spec/model/has_title_spec.rb