<commit_before>require 'rails_helper'

RSpec.describe Drop, :vcr => {:cassette_name => "place" } do

  it 'must have a SoundCloud track' do
    drop_test = build(:drop, sc_track: nil)
    expect(drop_test).not_to be_valid
  end

  it 'has a place' do
    drop_test = create(:drop, place_id: 1)
    expect(drop_test.place_id).to eql 1
  end

  it 'must have numerical sc_track' do
    drop_test = build(:drop, sc_track: "abc")
    expect(drop_test).not_to be_valid
  end

  describe '#image_from_track' do
    #http://www.rubydoc.info/github/soundcloud/soundcloud-ruby/SoundCloud/HashResponseWrapper#initialize-instance_method
    let(:with_url) { SoundCloud::HashResponseWrapper.new(artwork_url: "https://www.artwork-large.jpg") }<commit_msg>Refactor existing examples to use shoulda matchers<commit_after>require 'rails_helper'

RSpec.describe Drop, :vcr => {:cassette_name => "place" } do

  context 'with associations' do
    it { is_expected.to belong_to(:place) }
  end

  context 'with validations' do
    it { is_expected.to validate_presence_of(:sc_track) }
    it { is_expected.to validate_numericality_of(:sc_track).only_integer }
    it { is_expected.to validate_presence_of(:place_id) }
  end

  describe '#image_from_track' do
    #http://www.rubydoc.info/github/soundcloud/soundcloud-ruby/SoundCloud/HashResponseWrapper#initialize-instance_method
    let(:with_url) { SoundCloud::HashResponseWrapper.new(artwork_url: "https://www.artwork-large.jpg") }
{'fraction_non_alphanumeric': 0.1167235494880546, 'fraction_numerical': 0.0013651877133105802, 'mean_word_length': 4.817460317460317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2232568', 'n_tokens_mistral': 508, 'n_tokens_neox': 488, 'n_words': 98}