mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Improve specs
Better to rely on a verifying double and reveal our intentions using `subject` instead.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user