RSpec allows you to use the have_key predicate matcher to validate the presence of a key via has_key?, like so:
subject { described_class.order_items_by_revenue }
it "includes revenue key" do
expect(subject.first).to have_key(:revenue)
end
RSpec allows you to use the have_key predicate matcher to validate the presence of a key via has_key?, like so:
subject { described_class.order_items_by_revenue }
it "includes revenue key" do
expect(subject.first).to have_key(:revenue)
end