Sha256: 74e477cb933622122788168c2e61229c12a890d4841c04ecf49d1144c43b2885

Contents?: true

Size: 553 Bytes

Versions: 2

Compression:

Stored size: 553 Bytes

Contents

require 'spec_helper'

describe ApiClient::Errors do
  describe "#add_errors" do
    before :each do
      @errors = ApiClient::Errors.new(self).add_errors({:a => 'b'})
    end

    it "should initialize a new object" do
      @errors[:a].should == 'b'
    end
  end

  describe "#unique_messages" do
    before :each do
      @user = User.new
      @user.valid?
    end

    it "should set a unique message for each attribute" do
      @user.errors.unique_messages.should == { :a => "can't be blank and is not included in the list" }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api-client-1.5.2 spec/api-client/errors_spec.rb
api-client-1.5.1 spec/api-client/errors_spec.rb