Sha256: 919baf694a12530a67ab7c0831da69b10681d9a97b1b38ab257f3e7b5c654988

Contents?: true

Size: 559 Bytes

Versions: 3

Compression:

Stored size: 559 Bytes

Contents

require 'spec_helper'
require 'ostruct'

describe Grape::Exceptions::ValidationErrors do
  let(:validation_message) { "FooBar is invalid" }
  let(:validation_error) { OpenStruct.new(param: validation_message) }

  context "message" do
    context "is not repeated" do
      let(:error) do
        described_class.new(errors: [validation_error, validation_error])
      end
      subject(:message) { error.message.split(',').map(&:strip) }

      it { expect(message).to include validation_message }
      it { expect(message.size).to eq 1 }
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
grape-security-0.8.0 spec/grape/exceptions/validation_errors_spec.rb
grape-0.8.0 spec/grape/exceptions/validation_errors_spec.rb
grape-0.7.0 spec/grape/exceptions/validation_errors_spec.rb