spec/controllers/payanyway_controller_spec.rb in payanyway-2.0.1 vs spec/controllers/payanyway_controller_spec.rb in payanyway-2.0.2

- old
+ new

@@ -1,11 +1,11 @@ describe PayanywayController do routes { Payanyway::Engine.routes } describe 'GET #success' do - it 'should and message to logger' do - expect(Rails.logger).to receive(:info).with("PAYANYWAY: Called success payment url for order '676'") + it 'should add message to logger' do + expect(Rails.logger).to receive(:info).with("PAYANYWAY: Called success payment url for order '676'").and_call_original get :success, { 'MNT_TRANSACTION_ID' => 676 } end end @@ -16,19 +16,19 @@ get :fail, { 'MNT_TRANSACTION_ID' => 676 } end end describe 'GET #return' do - it 'should and message to logger' do + it 'should add message to logger' do expect(Rails.logger).to receive(:info).with("PAYANYWAY: Return from payanyway. Order '676'") get :return, { 'MNT_TRANSACTION_ID' => 676 } end end describe 'GET #in_progress' do - it 'should and message to logger' do + it 'should add message to logger' do expect(Rails.logger).to receive(:info).with("PAYANYWAY: Order '676' in progress") get :in_progress, { 'MNT_TRANSACTION_ID' => 676 } end end @@ -45,10 +45,10 @@ expect{ get(:check, { 'MNT_TRANSACTION_ID' => 676 }) }.to raise_error end end context 'when valid signature' do - it 'should and message to logger' do + it 'should add message to logger' do expect(Rails.logger).not_to receive(:info).with(/PAYANYWAY: XML response for check/) expect_any_instance_of(Payanyway::Controller).to receive(:check_implementation).and_return(amount: 12, state: :paid) get :check, { 'MNT_ID' => Payanyway::Gateway.config['moneta_id'].to_s, 'MNT_TRANSACTION_ID' => 676, 'MNT_SIGNATURE' => '79c1c4f41a0a70bb107c976ebba25811' }