Sha256: 074827b44d2b9f307a34f247b99fa8a6017e3c799a36098216129d36287c1c3f
Contents?: true
Size: 765 Bytes
Versions: 6
Compression:
Stored size: 765 Bytes
Contents
require File.expand_path('../../helper', __FILE__) describe ActiveRecord::QueryMethods::WhereChain do describe :like do it "creates an Arel Matches node in the relation" do relation = Post.where.like(title: '') relation.where_values.first.must_be_instance_of(Arel::Nodes::Matches) end describe "the Arel Node" do before do @attribute = "title" @value = '%value%' @relation_specifier = Post.where.like(@attribute => @value).where_values.first end it "has the attribute as the left operand" do @relation_specifier.left.name.must_equal @attribute end it "has the value as the right operand" do @relation_specifier.right.must_equal @value end end end end
Version data entries
6 entries across 6 versions & 1 rubygems