Skip to content

Commit

Permalink
fix cops
Browse files Browse the repository at this point in the history
  • Loading branch information
ccarruitero committed Nov 9, 2022
1 parent 1e20e73 commit 6cdf36c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions spec/models/solidus_content/entry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
end

specify "#data" do
expect(entry.entry_type)
allow(entry.entry_type)
.to receive(:content_for).with(entry).and_return(data: :foo)

expect(entry.data).to eq(:foo)
Expand All @@ -92,7 +92,7 @@
specify "#content" do
content = instance_double(Hash)

expect(entry.entry_type)
allow(entry.entry_type)
.to receive(:content_for).with(entry).and_return(content)

expect(entry.content).to eq(content)
Expand Down
2 changes: 1 addition & 1 deletion spec/models/solidus_content/entry_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

shared_examples 'a content provider' do
it 'calls the content-provider call method' do
expect(
allow(
SolidusContent.config.providers[provider_name.to_sym]
).to receive(:call).with(
slug: entry.slug,
Expand Down
4 changes: 2 additions & 2 deletions spec/solidus_content/providers/contentful_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
end

it 'returns data using Contentful client' do
expect(Contentful::Client)
allow(Contentful::Client)
.to receive(:new)
.with(space: contentful_space_id, access_token: contentful_access_token)
.and_return(contentful)

expect(contentful).to receive(:entry).with(entry_id).and_return(entry)
allow(contentful).to receive(:entry).with(entry_id).and_return(entry)

expect(subject[:data]).to eq(data)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/solidus_content/providers/dato_cms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
end

it 'returns data using DatoCMS client' do
expect(Dato::Site::Client)
allow(Dato::Site::Client)
.to receive(:new)
.with(api_token, environment: environment)
.and_return(dato)

expect(repo).to receive(:find).with(item_id, version: version).and_return(fields)
allow(repo).to receive(:find).with(item_id, version: version).and_return(fields)

expect(subject[:data]).to eq(fields)
end
Expand Down
8 changes: 4 additions & 4 deletions spec/solidus_content/providers/prismic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
end

it 'returns data using Prismic client' do
expect(::Prismic)
allow(::Prismic)
.to receive(:api)
.with(api_entry_point, api_token)
.and_return(prismic)

expect(prismic).to receive(:getByID).with(id).and_return(entry)
allow(prismic).to receive(:getByID).with(id).and_return(entry)

expect(subject[:data]).to eq(data)
end
Expand All @@ -68,12 +68,12 @@
end

it 'returns data using Prismic client' do
expect(::Prismic)
allow(::Prismic)
.to receive(:api)
.with(api_entry_point, nil)
.and_return(prismic)

expect(prismic).to receive(:getByID).with(id).and_return(entry)
allow(prismic).to receive(:getByID).with(id).and_return(entry)

expect(subject[:data]).to eq(data)
end
Expand Down

0 comments on commit 6cdf36c

Please sign in to comment.