Sha256: 97853bd498ed0600e3a2ecb76250ef68cf95897a8da3ad0a606378a459222623
Contents?: true
Size: 1.15 KB
Versions: 18
Compression:
Stored size: 1.15 KB
Contents
require 'spec_helper' describe Her::ErrorCollection do let(:metadata) { { :name => 'Testname' } } let(:errors) { { :name => ['not_present'] } } describe "#new" do context "without parameters" do subject { Her::ErrorCollection.new } it "raises upon access" do expect { subject[0] }.to raise_error(Her::Errors::ResponseError, "Cannot access collection, Request returned an error") expect { subject.last }.to raise_error(Her::Errors::ResponseError, "Cannot access collection, Request returned an error") end its(:metadata) { should eq({}) } its(:errors) { should eq({}) } end context "with parameters" do subject { Her::ErrorCollection.new(metadata, errors) } it "raises upon access" do expect { subject[0] }.to raise_error(Her::Errors::ResponseError, "Cannot access collection, Request returned an error") expect { subject.last }.to raise_error(Her::Errors::ResponseError, "Cannot access collection, Request returned an error") end its(:metadata) { should eq({ :name => 'Testname' }) } its(:errors) { should eq({ :name => ['not_present'] }) } end end end
Version data entries
18 entries across 18 versions & 1 rubygems