Sha256: 3e8bbb683d899547afe361268859de527aa55d0dd30f08f5088a8ad8fc80dae1

Contents?: true

Size: 595 Bytes

Versions: 45

Compression:

Stored size: 595 Bytes

Contents

require_relative "spec_helper"

describe "Sequel::Plugins::UnlimitedUpdate" do
  before do
    @db = Sequel.mock(:host=>'mysql', :numrows=>1)
    @db.extend_datasets{def quote_identifiers?; false end}
    @c = Class.new(Sequel::Model(@db[:test]))
    @c.columns :id, :name
    @o = @c.load(:id=>1, :name=>'a')
    @db.sqls
  end

  it "should remove limit from update dataset" do
    @o.save
    @db.sqls.must_equal ["UPDATE test SET name = 'a' WHERE (id = 1) LIMIT 1"]

    @c.plugin :unlimited_update
    @o.save
    @db.sqls.must_equal ["UPDATE test SET name = 'a' WHERE (id = 1)"]
  end
end

Version data entries

45 entries across 41 versions & 2 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/sequel-5.26.0/spec/extensions/unlimited_update_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/sequel-5.26.0/spec/extensions/unlimited_update_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/sequel-5.29.0/spec/extensions/unlimited_update_spec.rb
sequel-5.29.0 spec/extensions/unlimited_update_spec.rb
sequel-5.28.0 spec/extensions/unlimited_update_spec.rb
sequel-5.27.0 spec/extensions/unlimited_update_spec.rb
tdiary-5.1.0 vendor/bundle/gems/sequel-5.26.0/spec/extensions/unlimited_update_spec.rb
sequel-5.26.0 spec/extensions/unlimited_update_spec.rb
sequel-5.25.0 spec/extensions/unlimited_update_spec.rb
sequel-5.24.0 spec/extensions/unlimited_update_spec.rb
sequel-5.23.0 spec/extensions/unlimited_update_spec.rb
sequel-5.22.0 spec/extensions/unlimited_update_spec.rb
sequel-5.21.0 spec/extensions/unlimited_update_spec.rb
sequel-5.20.0 spec/extensions/unlimited_update_spec.rb
tdiary-5.0.13 vendor/bundle/gems/sequel-5.18.0/spec/extensions/unlimited_update_spec.rb
sequel-5.19.0 spec/extensions/unlimited_update_spec.rb
tdiary-5.0.12.1 vendor/bundle/gems/sequel-5.18.0/spec/extensions/unlimited_update_spec.rb
sequel-5.18.0 spec/extensions/unlimited_update_spec.rb
sequel-5.17.0 spec/extensions/unlimited_update_spec.rb
sequel-5.16.0 spec/extensions/unlimited_update_spec.rb