spec/emites/resources/emitter_spec.rb in emites-client-0.1.1 vs spec/emites/resources/emitter_spec.rb in emites-client-0.1.2
- old
+ new
@@ -69,11 +69,11 @@
describe "#list" do
it "returns an array of emitters" do
VCR.use_cassette("emitters/list/success") do
entities = subject.list
- expect(entities).to be_a(Array)
+ expect(entities).to be_a(Emites::Entities::Collection)
entities.each do |e|
expect(e).to be_a(entity_klass)
end
end
end
@@ -81,21 +81,21 @@
describe "#search" do
it "returns an array of emitters where CNPJ is '17799377000155'" do
VCR.use_cassette("emitters/search/success") do
entities = subject.search({ cnpj: "17799377000155" })
- expect(entities).to be_a(Array)
+ expect(entities).to be_a(Emites::Entities::Collection)
expect(entities.count).to eq(1)
entities.each do |e|
expect(e).to be_a(entity_klass)
end
end
end
it "returns empty" do
VCR.use_cassette("emitters/search/returns_empty") do
entities = subject.search({ cnpj: "1775" })
- expect(entities).to be_a(Array)
+ expect(entities).to be_a(Emites::Entities::Collection)
expect(entities).to be_empty
end
end
end