Sha256: 0477e6c95d8494ecbbb761a6b57999c27fce64c1dda98d82075740679c78b736

Contents?: true

Size: 466 Bytes

Versions: 34

Compression:

Stored size: 466 Bytes

Contents

require File.join(File.dirname(File.expand_path(__FILE__)), "spec_helper")

describe "Sequel::Plugins::ErrorSplitter" do
  before do
    @c = Class.new(Sequel::Model)
    @c.plugin :error_splitter
    @m = @c.new
    def @m.validate
      errors.add([:a, :b], 'is bad')
    end
  end

  it "should split errors for multiple columns and assign them to each column" do
    @m.valid?.must_equal false
    @m.errors.must_equal(:a=>['is bad'], :b=>['is bad'])
  end
end

Version data entries

34 entries across 32 versions & 2 rubygems

Version Path
tdiary-5.0.1 vendor/bundle/gems/sequel-4.35.0/spec/extensions/error_splitter_spec.rb
sequel-4.35.0 spec/extensions/error_splitter_spec.rb
sequel-4.34.0 spec/extensions/error_splitter_spec.rb
sequel-4.33.0 spec/extensions/error_splitter_spec.rb
sequel-4.32.0 spec/extensions/error_splitter_spec.rb
sequel-4.31.0 spec/extensions/error_splitter_spec.rb
sequel-4.30.0 spec/extensions/error_splitter_spec.rb
sequel-4.29.0 spec/extensions/error_splitter_spec.rb
sequel-4.28.0 spec/extensions/error_splitter_spec.rb
sequel-4.27.0 spec/extensions/error_splitter_spec.rb
sequel-4.26.0 spec/extensions/error_splitter_spec.rb
sequel-4.25.0 spec/extensions/error_splitter_spec.rb
sequel-4.24.0 spec/extensions/error_splitter_spec.rb
sequel-4.23.0 spec/extensions/error_splitter_spec.rb