Sha256: 6519170b0048f3f6e8c1b85eb3dd5c0dc43b7313edccefd0ed825dfc277b5e7d

Contents?: true

Size: 879 Bytes

Versions: 1

Compression:

Stored size: 879 Bytes

Contents

#encoding: utf-8

require 'spec_helper'

describe HH::API::EmployerVacancies do
  let(:client) { HH::Client.new }
  let(:employer_id) { 7135086 }
  let(:request_path) { "employers/#{employer_id}/vacancies" }

  describe "#employer_vacancies" 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.employer_vacancies(employer_id)
      expect(a_get(request_path)).to have_been_made
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hh-0.0.7 spec/hh/api/employer_vacancies_spec.rb