spec/lib/contentful/management/entry_spec.rb in contentful-management-1.8.1 vs spec/lib/contentful/management/entry_spec.rb in contentful-management-1.9.0

- old
+ new

@@ -158,11 +158,11 @@ vcr('entry/unpublish_already_unpublished') do result = subject.find(space_id, entry_id).unpublish expect(result).to be_kind_of Contentful::Management::BadRequest expect(result.message).to eq 'Not published' expect(result.error[:message]).to eq 'Not published' - expect(result.error[:url]).to eq '/yr5m0jky5hsh/entries/4Rouux8SoUCKwkyCq2I0E0/published' + expect(result.error[:url]).to eq 'spaces/yr5m0jky5hsh/entries/4Rouux8SoUCKwkyCq2I0E0/published' expect(result.error[:details]).to eq "{\n \"sys\": {\n \"type\": \"Error\",\n \"id\": \"BadRequest\"\n },\n \"message\": \"Not published\"\n}\n" end end end @@ -771,22 +771,22 @@ loc.lat = 22.44 loc.lon = 33.33 end attributes = { - name: 'Test name', - number: 30, - float1: 1.1, - boolean: true, date: '2000-07-12T11:11:00+02:00', - time: '2000-07-12T11:11:00+02:00', - location: location, - image: Asset.new, - images: [Asset.new, Asset.new], - array: %w(PL USD XX), - entry: Entry.new, - entries: [Entry.new, Entry.new], - object_json: {'test' => {'@type' => 'Codequest'}} + name: 'Test name', + number: 30, + float1: 1.1, + boolean: true, date: '2000-07-12T11:11:00+02:00', + time: '2000-07-12T11:11:00+02:00', + location: location, + image: Asset.new, + images: [Asset.new, Asset.new], + array: %w(PL USD XX), + entry: Entry.new, + entries: [Entry.new, Entry.new], + object_json: {'test' => {'@type' => 'Codequest'}} } parsed_attributes = Entry.new.fields_from_attributes(attributes) expect(parsed_attributes[:name]).to match('en-US' => 'Test name') @@ -805,11 +805,11 @@ end it 'keepd hashes in attributes' do attributes = { - entries: [{sys: {type: 'Link', linkType: 'Entry', id: nil}}, {sys: {type: 'Link', linkType: 'Entry', id: nil}}] + entries: [{sys: {type: 'Link', linkType: 'Entry', id: nil}}, {sys: {type: 'Link', linkType: 'Entry', id: nil}}] } parsed_attributes = Entry.new.fields_from_attributes(attributes) expect(parsed_attributes[:entries]).to match('en-US' => [{sys: {type: 'Link', linkType: 'Entry', id: nil}}, {sys: {type: 'Link', linkType: 'Entry', id: nil}}]) @@ -1038,56 +1038,56 @@ end end end describe 'without dynamic entries' do - it 'on an already populated field' do - vcr('entry/issue_61.7') { - begin - client.configuration[:default_locale] = 'en-GB' + it 'on an already populated field' do + vcr('entry/issue_61.7') { + begin + client.configuration[:default_locale] = 'en-GB' - expected_entry = subject.find('u2viwgfeal0o', 'fIpsfQSOd22IsqMQCiG0K') + expected_entry = subject.find('u2viwgfeal0o', 'fIpsfQSOd22IsqMQCiG0K') - expect(expected_entry.value).to eq 'hello' + expect(expected_entry.value).to eq 'hello' - expected_entry.value = 'goodbye' + expected_entry.value = 'goodbye' - expected_entry.save - expected_entry.publish + expected_entry.save + expected_entry.publish - expect(expected_entry.value).to eq 'goodbye' - ensure - expected_entry.value = 'hello' + expect(expected_entry.value).to eq 'goodbye' + ensure + expected_entry.value = 'hello' - expected_entry.save - expected_entry.publish - end - } - end + expected_entry.save + expected_entry.publish + end + } + end - it 'on a previously empty field' do - vcr('entry/issue_61.8') { - begin - client.configuration[:default_locale] = 'en-GB' + it 'on a previously empty field' do + vcr('entry/issue_61.8') { + begin + client.configuration[:default_locale] = 'en-GB' - expected_entry = subject.find('u2viwgfeal0o', '2GmtCwDBcIu4giMgQGIIcq') + expected_entry = subject.find('u2viwgfeal0o', '2GmtCwDBcIu4giMgQGIIcq') - expect(expected_entry.value).to eq nil + expect(expected_entry.value).to eq nil - expected_entry.value = 'goodbye' + expected_entry.value = 'goodbye' - expected_entry.save - expected_entry.publish + expected_entry.save + expected_entry.publish - expect(expected_entry.value).to eq 'goodbye' - ensure - expected_entry.value = nil + expect(expected_entry.value).to eq 'goodbye' + ensure + expected_entry.value = nil - expected_entry.save - expected_entry.publish - end - } - end + expected_entry.save + expected_entry.publish + end + } + end end end end end end