Sha256: 8813d64337c5353894207a82dd09529a5c739177e03fa938b5c6003ce3f346ff

Contents?: true

Size: 660 Bytes

Versions: 20

Compression:

Stored size: 660 Bytes

Contents

require "spec_helper"

describe "ActiveSupport::Relation =~ matcher" do
  before { MockableModel.delete_all }
  
  let!(:models) { Array.new(3) { MockableModel.create } }

  it "verifies that the scope returns the records on the right hand side, regardless of order" do
    MockableModel.scoped.should =~ models.reverse
  end

  it "fails if the scope encompasses more records than on the right hand side" do
    MockableModel.create
    MockableModel.scoped.should_not =~ models.reverse
  end

  it "fails if the scope encompasses fewer records than on the right hand side" do
    MockableModel.limit(models.length - 1).should_not =~ models.reverse
  end
end

Version data entries

20 entries across 15 versions & 4 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
rspec-rails-2.11.4 spec/rspec/rails/matchers/relation_match_array_spec.rb
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/relation_match_array_spec.rb
rspec-rails-2.11.0 spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/relation_match_array_spec.rb
rspec-rails-2.10.1 spec/rspec/rails/matchers/relation_match_array_spec.rb
rspec-rails-2.10.0 spec/rspec/rails/matchers/relation_match_array_spec.rb
rspec-rails-2.9.0 spec/rspec/rails/matchers/relation_match_array_spec.rb
rspec-rails-2.9.0.rc2 spec/rspec/rails/matchers/relation_match_array_spec.rb