Sha256: 59f3c532d4a469b2452655ff3f69b0e904ecf8628a85586ea6c3a5621b4a4d71

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

#encoding: utf-8

require 'spec_helper'

describe HH::API::Specialization do
  let(:client) { HH::Client.new }

  describe "#specializations" do

    before do
      stub_get("specialization/all").to_return(body: fixture("specialization_all.json"), headers: {content_type: "application/json; charset=utf-8"})
    end

    it "requests the correct resource" do
      client.specializations
      expect(a_get("specialization/all")).to have_been_made
    end

    it "returns the requested specializations" do
      specializations = client.specializations
      expect(specializations).to be_an Array
      expect(specializations.first).to be_an Hash
      expect(specializations.first[:name]).to eq "Маркшейдер"
    end
  end

  describe "#specialization" do

    before do
      stub_get("specialization/474").to_return(body: fixture("specialization.json"), headers: {content_type: "application/json; charset=utf-8"})
    end

    it "requests the correct resource" do
      client.specialization(474)
      expect(a_get("specialization/474")).to have_been_made
    end

    it "returns the requested specialization" do
      specializations = client.specialization(474)
      expect(specializations).to be_an Hash
      expect(specializations[:id]) == 474
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hh-0.0.7 spec/hh/api/specialization_spec.rb
hh-0.0.6 spec/hh/api/specialization_spec.rb
hh-0.0.5 spec/hh/api/specialization_spec.rb
hh-0.0.4 spec/hh/api/specialization_spec.rb