Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rspec-rails from 5.1.2 to 6.0.1 #9850

Merged
merged 2 commits into from
Feb 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions spec/controllers/spree/admin/base_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def index

it "passes a prefix to the serializer method and renders with serializer" do
expect(controller).to receive(:serializer).with(prefix) { "SerializerClass" }
expect(controller).to receive(:render).with(json: data, serializer: "SerializerClass")
expect(controller).to receive(:render).with({ json: data, serializer: "SerializerClass" })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I would have thought that Rails would have changed the controller arguments over to keyword arguments, but I guess they didn't.

controller.send(:render_as_json, data, ams_prefix: prefix)
end
end
Expand All @@ -34,7 +34,7 @@ def index

it "does not pass a prefix to the serializer method and renders with serializer" do
expect(controller).to receive(:serializer).with(prefix) { "SerializerClass" }
expect(controller).to receive(:render).with(json: data, serializer: "SerializerClass")
expect(controller).to receive(:render).with({ json: data, serializer: "SerializerClass" })
controller.send(:render_as_json, data, ams_prefix: prefix)
end
end
Expand All @@ -48,8 +48,9 @@ def index

it "passes a prefix to the serializer method and renders with each_serializer" do
expect(controller).to receive(:serializer).with(prefix) { "SerializerClass" }
expect(controller).to receive(:render).with(json: data,
each_serializer: "SerializerClass")
expect(controller).to receive(:render).with(
{ json: data, each_serializer: "SerializerClass" }
)
controller.send(:render_as_json, data, ams_prefix: prefix)
end
end
Expand All @@ -59,8 +60,9 @@ def index

it "does not pass a prefix to the serializer method and renders with each_serializer" do
expect(controller).to receive(:serializer).with(prefix) { "SerializerClass" }
expect(controller).to receive(:render).with(json: data,
each_serializer: "SerializerClass")
expect(controller).to receive(:render).with(
{ json: data, each_serializer: "SerializerClass" }
)
controller.send(:render_as_json, data, ams_prefix: prefix)
end
end
Expand Down