Sha256: a999b77a3a8763a778cd97fc4d94ffb12d4d7017986571a9a4eec349d9e1bbb4

Contents?: true

Size: 682 Bytes

Versions: 10

Compression:

Stored size: 682 Bytes

Contents

require 'spec_helper'

class CollectionOwner < ActiveRecord::Base
  connection.execute <<-SQL
    CREATE TABLE collection_owners (
      id integer PRIMARY KEY AUTOINCREMENT
    )
SQL
  has_many :associated_items do
    def has_some_quality?; true end
  end
end

class AssociatedItem < ActiveRecord::Base
  connection.execute <<-SQL
    CREATE TABLE associated_items (
      id integer PRIMARY KEY AUTOINCREMENT,
      collection_owner_id integer
    )
SQL
  belongs_to :collection_owner
end

describe "should have_xxx" do
  it "works with ActiveRecord::Associations::CollectionProxy" do
    owner = CollectionOwner.new
    owner.associated_items.should have_some_quality
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-rails-2.13.0/spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.14.1 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-3.0.0.beta1 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.99.0.beta1 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.14.0 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.13.1 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.13.0 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.12.2 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.12.1 spec/rspec/rails/matchers/has_spec.rb
rspec-rails-2.12.0 spec/rspec/rails/matchers/has_spec.rb