Sha256: 763973db3e7beba41c1e6c4389c2ad2d4aea04933d14367ead2b05c9d53ef4d5
Contents?: true
Size: 1.8 KB
Versions: 5
Compression:
Stored size: 1.8 KB
Contents
require 'spec_helper' module WirecardGiropay describe Response do def read_sample_file(file) File.read File.expand_path('../../../support/' + file, __FILE__) end let(:success_xml) { read_sample_file 'sample_response_success.xml' } let(:failure_xml) { read_sample_file 'sample_response_failure.xml' } let(:redirect_html) { read_sample_file 'sample_redirect.html' } let(:success_response) { Response.from_xml success_xml } let(:failure_response) { Response.from_xml failure_xml } describe '#params' do context 'for a success response' do let(:params) { success_response.params } it('params[:success] returns true') { expect(params[:success]).to eq true } it('params[:redirect_html] returns the right html') { expect(params[:redirect_html]).to eq redirect_html } it('params[:status_code] returns O20') { expect(params[:status_code]).to eq 'O20' } it('params[:reason_code] returns O2010') { expect(params[:reason_code]).to eq 'O2010' } it('params[:guwid] returns the correct guwid') { expect(params[:guwid]).to eq 'F815887120947517965048' } end context 'for a failure response' do let(:params) { failure_response.params } it('params[:success] returns false') { expect(params[:success]).to eq false } it('params[:redirect_html] returns ""') { expect(params[:redirect_html]).to eq '' } it('params[:status_code] returns O30') { expect(params[:status_code]).to eq 'O30' } it('params[:reason_code] returns O3050') { expect(params[:reason_code]).to eq 'O3050' } it('params[:guwid] returns the correct guwid') { expect(params[:guwid]).to eq 'F815207120947498218406' } end end end end
Version data entries
5 entries across 5 versions & 1 rubygems