Sha256: 87e89a6c3f529b4122cb80ca5dc756aca3a945b56d9741e30658ac8a71b99b6d

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

require File.expand_path('../../helper', __FILE__)

describe ActiveRecord::QueryMethods::WhereChain do
  describe :not_like do
    it "creates an Arel DoesNotMatch node in the relation" do
      relation = Post.where.not_like(title: '')

      relation.where_values.first.must_be_instance_of(Arel::Nodes::DoesNotMatch)
    end

    describe "the Arel Node" do
      before do
        @attribute = "title"
        @value = '%value%'

        @relation_specifier = Post.where.not_like(@attribute => @value).where_values.first
      end

      it "has the attribute as the left operand" do
        @relation_specifier.left.name.must_equal @attribute
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-like-1.0.0 test/unit/not_like_test.rb