My layout only works when it is in the previous block shown below. This is just my quick and dirty idea of my problem. Literally, when I move a line from the previous block to the statement does not quack , it stops taunting does not quack
describe 'Ducks', type: :feature do before do ... allow_any_instance_of(Duck).to receive(:quack).and_return('bark!') visit animal_farm_path end context 'is an odd duck' it 'does not quack' do expect(Duck.new.quack).to eq('bark!') end end end
I want it here, but it does not work:
describe 'Ducks', type: :feature do before do ... visit animal_farm_path end context 'is an odd duck' it 'does not quack' do allow_any_instance_of(Duck).to receive(:quack).and_return('bark!') expect(Duck.new.quack).to eq('bark!') end end end
source share