Improve specs

Better to rely on a verifying double and reveal our intentions using
`subject` instead.
This commit is contained in:
Pau Perez
2021-03-16 15:21:37 +01:00
parent a1af16ae72
commit 5ee647fd7c
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ describe Spree::UsersController, type: :controller do
end
context 'when the customer_balance feature is enabled' do
let(:outstanding_balance) { double(:outstanding_balance) }
let(:outstanding_balance) { instance_double(OutstandingBalance) }
before do
allow(OpenFoodNetwork::FeatureToggle)

View File

@@ -3,7 +3,7 @@
require 'spec_helper'
describe OutstandingBalance do
let(:outstanding_balance) { described_class.new(relation) }
subject(:outstanding_balance) { described_class.new(relation) }
describe '#statement' do
let(:relation) { Spree::Order.none }