Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 9f976cb3e9
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (15 sloc) 0.66 kB
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
Jump to Line
Something went wrong with that request. Please try again.