aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/unit/relations/skip_spec.rb
blob: d83c969aa859fa14d9dfc188562044407500a7b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')

module Arel
  describe Skip do
    before do
      @relation = Table.new(:users)
      @skipped = 4
    end

    describe '#to_sql' do
      it "manufactures sql with limit and offset" do
        Skip.new(@relation, @skipped).to_s.should be_like("
          SELECT `users`.`id`, `users`.`name`
          FROM `users`
          OFFSET #{@skipped}
        ")
      end
    end
  end
end