Sha256: b5f2d172b2d070d50663284150091ee40c292e7257f0ee18fd4cc01a46b568d7
Contents?: true
Size: 645 Bytes
Versions: 17
Compression:
Stored size: 645 Bytes
Contents
require 'spec_helper' describe Grape::Exceptions::Validation do it 'fails when params are missing' do expect { Grape::Exceptions::Validation.new(message: 'presence') }.to raise_error(ArgumentError, 'missing keyword: params') end context 'when message is a symbol' do it 'stores message_key' do expect(Grape::Exceptions::Validation.new(params: ['id'], message: :presence).message_key).to eq(:presence) end end context 'when message is a String' do it 'does not store the message_key' do expect(Grape::Exceptions::Validation.new(params: ['id'], message: 'presence').message_key).to eq(nil) end end end
Version data entries
17 entries across 17 versions & 2 rubygems