Sha256: f0f89bb4f1e3ffc81061b105931e40c4c4f25269af15dee815768a7263e3f67c

Contents?: true

Size: 972 Bytes

Versions: 1

Compression:

Stored size: 972 Bytes

Contents

RSpec.describe ChgkRating::Models::Rating do
  subject do
    VCR.use_cassette 'rating_release' do
      described_class.new 24, team: 1
    end
  end
  let(:rating_h) { subject.to_h }

  it_behaves_like 'model without eager loading'
  it_behaves_like 'model without lazy support'

  specify('#team') { expect(subject.team.id).to eq '1' }
  specify('#release_id') { expect(subject.release_id).to eq '24' }
  specify('#rating') { expect(subject.rating).to eq 9071 }
  specify('#rating_position') { expect(subject.rating_position).to eq 9 }
  specify('#date') { expect(subject.date).to eq Date.new(1999, 01, 07) }
  specify('#formula') { expect(subject.formula).to eq :b }

  specify '#to_h' do
    expect(rating_h['idteam']).to eq '1'
    expect(rating_h['idrelease']).to eq '24'
    expect(rating_h['rating']).to eq '9071'
    expect(rating_h['rating_position']).to eq '9'
    expect(rating_h['date']).to eq '1999-01-07'
    expect(rating_h['formula']).to eq 'b'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chgk_rating-1.0.0.rc1 spec/lib/chgk_rating/models/rating_spec.rb