Sha256: d4d2961fc51bc06362d5a24761b02d523af7aef79279fffba76544e457a9ca9f

Contents?: true

Size: 903 Bytes

Versions: 1

Compression:

Stored size: 903 Bytes

Contents

require 'spec_helper'

describe Zaim::User do

  let(:request_url) { 'https://api.zaim.net/v2/home/user/verify' }
  let(:response_headers) { { content_type: 'application/json' } }
  let(:response_body) { File.read('spec/fixtures/user/verify.json') }
  let(:response) { { body: response_body, status: 200, headers: response_headers } }
  let(:client) { Zaim::Client.new }

  describe "#verify" do

    before do
      stub_request( :get, request_url ).to_return( response )
    end

    subject { client.verify }

    it { expect( subject ).to be_an_instance_of Hash }
    it { expect( subject ).to include('requested') }
    it { expect( subject ).to include('me') }

    context "response 'me'" do

      %w( id login name input_count day_count repeat_count day week month currency_code ).each do |key_name|
        it { expect( subject.fetch 'me' ).to include(key_name) }
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zaim-0.0.1 spec/zaim/user_spec.rb