Sha256: 86c5d98c25be996bf411c72e5482c846a2638927e85ce242ba07919422bee7b0

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

require "spec_helper"

describe Parelation::Criteria::Offset do

  let(:klass) { Parelation::Criteria::Offset }

  it "should match" do
    expect(klass.match?("offset")).to eq(true)
  end

  it "should not match" do
    expect(klass.match?("query")).to eq(false)
  end

  it "should add criteria to the chain" do
    criteria = klass.new(Ticket.all, "offset", "40").call
    ar_query = Ticket.offset(40)

    expect(criteria.to_sql).to eq(ar_query.to_sql)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
parelation-1.0.0 spec/lib/criteria/offset_spec.rb
parelation-0.2.0 spec/lib/criteria/offset_spec.rb
parelation-0.1.0 spec/lib/criteria/offset_spec.rb
parelation-0.0.1 spec/lib/criteria/offset_spec.rb