Sha256: 3d80e7209bd1d5d5bf9d3bfd75e7929108131a9604fa65cdaea998532c5908d3

Contents?: true

Size: 465 Bytes

Versions: 18

Compression:

Stored size: 465 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?.should == false
    @m.errors.should == {:a=>['is bad'], :b=>['is bad']}
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
sequel-4.22.0 spec/extensions/error_splitter_spec.rb
sequel-4.21.0 spec/extensions/error_splitter_spec.rb
sequel-4.20.0 spec/extensions/error_splitter_spec.rb
sequel-4.19.0 spec/extensions/error_splitter_spec.rb
sequel-4.18.0 spec/extensions/error_splitter_spec.rb
sequel-4.17.0 spec/extensions/error_splitter_spec.rb
sequel-4.16.0 spec/extensions/error_splitter_spec.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/spec/extensions/error_splitter_spec.rb
sequel-4.15.0 spec/extensions/error_splitter_spec.rb
sequel-4.14.0 spec/extensions/error_splitter_spec.rb
sequel-4.13.0 spec/extensions/error_splitter_spec.rb
sequel-4.12.0 spec/extensions/error_splitter_spec.rb
sequel-4.11.0 spec/extensions/error_splitter_spec.rb
sequel-4.10.0 spec/extensions/error_splitter_spec.rb
sequel-4.9.0 spec/extensions/error_splitter_spec.rb
sequel-4.8.0 spec/extensions/error_splitter_spec.rb
sequel-4.7.0 spec/extensions/error_splitter_spec.rb
sequel-4.6.0 spec/extensions/error_splitter_spec.rb