spec/lib/contentful/management/entry_spec.rb in contentful-management-0.2.1 vs spec/lib/contentful/management/entry_spec.rb in contentful-management-0.3.0
- old
+ new
@@ -1,6 +1,5 @@
-# -*- encoding: utf-8 -*-
require 'spec_helper'
require 'contentful/management/space'
require 'contentful/management/client'
module Contentful
@@ -54,10 +53,17 @@
vcr('entry/find_not_found') do
result = subject.find(space_id, 'not_exist')
expect(result).to be_kind_of Contentful::Management::NotFound
end
end
+
+ it 'returns an error when service is unavailable' do
+ vcr('entry/service_unavailable') do
+ result = subject.find(space_id, 'not_exist')
+ expect(result).to be_kind_of Contentful::Management::ServiceUnavailable
+ end
+ end
end
describe '#destroy' do
it 'returns Contentful::BadRequest error when content type is published' do
vcr('entry/destory_published') do
@@ -259,15 +265,15 @@
end
it 'with entries' do
vcr('entry/create_with_entries') do
entry_att = Entry.find(space_id, '1d1QDYzeiyWmgqQYysae8u')
- entry2 = subject.create(content_type,
+ new_entry = subject.create(content_type,
name: 'EntryWithEntries',
age: 20,
entries: [entry_att, entry_att, entry_att])
- expect(entry2.name).to eq 'EntryWithEntries'
- expect(entry2.age).to eq 20
+ expect(new_entry.name).to eq 'EntryWithEntries'
+ expect(new_entry.age).to eq 20
end
end
it 'with asset' do
vcr('entry/create_with_asset') do