Sha256: bedf63fde6681975ee8b2c4be82d9d3473b0c1ab813f6accbc5f4504bf924188
Contents?: true
Size: 836 Bytes
Versions: 15
Compression:
Stored size: 836 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 describe '#unique_message' do before :each do @user = User.new @user.valid? end it 'should return a unique message for the given attribute' do @user.errors.unique_message(:a).should == "can't be blank and is not included in the list" end end end
Version data entries
15 entries across 15 versions & 1 rubygems