Sha256: 2daaa1f4efd23cb8162bdad88fd14b0f0f34ced48b6cd5004720935a071deef2

Contents?: true

Size: 826 Bytes

Versions: 44

Compression:

Stored size: 826 Bytes

Contents

require 'spec_helper'

RSpec.describe 'DataModels::Client' do
  subject { PatronusFati::DataModels::Client }

  let(:unsaved_instance) { subject.new(bssid: '12:34:56:00:00:02') }
  let(:saved_instance)   { unsaved_instance.save }

  it { expect(subject).to have_property(:id) }
  it { expect(subject).to have_property(:bssid) }
  it { expect(subject).to have_property(:last_seen_at) }

  it { expect(subject).to have_many(:probes) }

  it { expect(subject).to have_many(:connections) }
  it { expect(subject).to have_many(:access_points).through(:connections) }

  it { expect(subject).to belong_to(:mac) }

  it 'should associate to a MAC object before saving' do
    expect(unsaved_instance.mac).to be_nil
    unsaved_instance.save
    expect(unsaved_instance.mac).to be_instance_of(PatronusFati::DataModels::Mac)
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
patronus_fati-0.8.3 spec/data_models/client_spec.rb
patronus_fati-0.8.2 spec/data_models/client_spec.rb
patronus_fati-0.8.1 spec/data_models/client_spec.rb
patronus_fati-0.8.0 spec/data_models/client_spec.rb