Skip to content

Commit 5c71923

Browse files
rzanekares
authored andcommitted
Add tests for limit and offset substitution
1 parent e0fa623 commit 5c71923

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/db/firebird/simple_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ def test_raw_insert_bind_param_with_q_mark_deprecated; end
125125
assert_kind_of Arel::Visitors::Firebird, visitor
126126
end if ar_version('3.0')
127127

128+
def test_arel_visitor_limit
129+
assert_equal Entry.limit(3).to_sql, "SELECT FIRST 3 \"ENTRIES\".* FROM \"ENTRIES\" "
130+
end
131+
132+
def test_arel_visitor_offset
133+
assert_equal Entry.offset(3).to_sql, "SELECT SKIP 3 \"ENTRIES\".* FROM \"ENTRIES\" "
134+
end
135+
136+
def test_arel_visitor_limit_and_offset
137+
sql = "SELECT FIRST 3 SKIP 3 \"ENTRIES\".* FROM \"ENTRIES\" "
138+
assert_equal Entry.limit(3).offset(3).to_sql, sql
139+
end
128140
end
129141

130142
class FirebirdHasManyThroughTest < Test::Unit::TestCase

0 commit comments

Comments
 (0)