Skip to content

Commit

Permalink
Remove merge artifacts
Browse files Browse the repository at this point in the history
  These specs were reintroduced in the merge b/c we had moved the spec
  examples in master
  • Loading branch information
gburgett committed Mar 26, 2020
1 parent baff0d9 commit fcf7cc5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 66 deletions.
2 changes: 1 addition & 1 deletion wcc-contentful/lib/wcc/contentful/store/factory.rb
Expand Up @@ -51,7 +51,7 @@ def build(config = WCC::Contentful.configuration, services = WCC::Contentful::Se

middleware, params, configure_proc = middleware_config
middleware = middleware.call(memo, *params, **options)
middleware.instance_exec(&configure_proc) if configure_proc
middleware&.instance_exec(&configure_proc) if configure_proc
middleware || memo
end
end
Expand Down
Expand Up @@ -211,24 +211,6 @@
expect(prior2).to eq(data)
expect(subject.find('1234')).to eq(data2)
end

it 'instruments set' do
data = { 'key' => 'val', '1' => { 'deep' => 9 } }

expect {
# act
subject.set('1234', data)
}.to instrument('set.store.contentful.wcc')
.with(hash_including(id: '1234'))
end

it 'instruments find' do
expect {
# act
subject.find('1234')
}.to instrument('find.store.contentful.wcc')
.with(hash_including(id: '1234'))
end
end

describe '#delete' do
Expand All @@ -255,14 +237,6 @@
expect(deleted).to be_nil
expect(subject.find('9999')).to eq(data)
end

it 'instruments delete' do
expect {
# act
subject.delete('1234')
}.to instrument('delete.store.contentful.wcc')
.with(hash_including(id: '1234'))
end
end

describe '#index' do
Expand Down Expand Up @@ -449,31 +423,6 @@
expect(latest).to eq(existing)
expect(subject.find(deleted_asset.dig('sys', 'id'))).to eq(existing)
end

it 'instruments index set' do
expect {
expect {
# act
subject.index(entry)
}.to instrument('index.store.contentful.wcc')
.with(hash_including(id: '1qLdW7i7g4Ycq6i4Cckg44'))
}.to instrument('set.store.contentful.wcc')
.with(hash_including(id: '1qLdW7i7g4Ycq6i4Cckg44'))
end

it 'instruments index delete' do
existing = { 'test' => { 'data' => 'asdf' } }
subject.set('6HQsABhZDiWmi0ekCouUuy', existing)

expect {
expect {
# act
subject.index(deleted_entry)
}.to instrument('index.store.contentful.wcc')
.with(hash_including(id: '6HQsABhZDiWmi0ekCouUuy'))
}.to instrument('delete.store.contentful.wcc')
.with(hash_including(id: '6HQsABhZDiWmi0ekCouUuy'))
end
end

describe '#find_by' do
Expand Down Expand Up @@ -597,13 +546,6 @@
expect(found.dig('sys', 'id')).to eq('idTwo')
expect(found.dig('fields', 'system', 'en-US')).to eq('Two')
end

it 'instruments find_by' do
expect {
subject.find_by(content_type: 'test2')
}.to instrument('find_by.store.contentful.wcc')
.with(hash_including(content_type: 'test2'))
end
end

describe '#find_all' do
Expand Down Expand Up @@ -671,13 +613,6 @@
expect(found.count).to eq(1)
expect(found.first.dig('sys', 'id')).to eq('k5')
end

it 'instruments find_all' do
expect {
subject.find_all(content_type: 'test2')
}.to instrument('find_all.store.contentful.wcc')
.with(hash_including(content_type: 'test2'))
end
end

def make_link_to(id, link_type = 'Entry')
Expand Down

0 comments on commit fcf7cc5

Please sign in to comment.