Sha256: 8124564556423a798ac3a1a58e5590c9deb2a5033935702d02357023b25aebde

Contents?: true

Size: 856 Bytes

Versions: 2

Compression:

Stored size: 856 Bytes

Contents

#encoding: utf-8

require 'spec_helper'

describe HH::API::VacancyEmployer do
  let(:client) { HH::Client.new }
  let(:vacancy_id) { 7135086 }
  let(:request_path) { "vacancy/employer/#{vacancy_id}" }

  describe "#vavancy_employer" do
    before do
      stub_get(request_path).to_return(body: fixture("vacancy_employer.json"), headers: {content_type: "application/json; charset=utf-8"})
    end

    it "requests the correct resource" do
      client.vavancy_employer(vacancy_id)
      expect(a_get(request_path)).to have_been_made
    end

    it "returns the requested metro list" do
      vavancy_employer = client.vavancy_employer(vacancy_id)
      expect(vavancy_employer).to be_an Array
      expect(vavancy_employer.first).to be_an Hash
      expect(vavancy_employer.first[:name]).to eq "Java разработчик (Минск)"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hh-0.0.6 spec/hh/api/vavancy_employer_spec.rb
hh-0.0.5 spec/hh/api/vavancy_employer_spec.rb