Sha256: 33d7b905faddadd778e2def4ff0aa5b737f4513a671927b47e8b7cec0c9bbf12

Contents?: true

Size: 400 Bytes

Versions: 4

Compression:

Stored size: 400 Bytes

Contents

require "spec_helper"

describe Parelation::Helpers do

  class ExampleController
    include Parelation::Helpers

    def params
      { "where" => { "state" => "open" } }
    end

    def index
      parelate(Ticket.all)
    end
  end

  it "should parelate the ticket criteria chain" do
    expect(ExampleController.new.index.to_sql)
      .to eq(Ticket.all.where(state: 'open').to_sql)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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