Files
onemdm-server/spec/models/device_spec.rb
Yedhu Krishnan 3947889282 Update device create API
- Update the existing device if a device with existing unique_id is
   present
2015-10-18 11:13:20 +05:30

16 lines
391 B
Ruby

require 'rails_helper'
RSpec.describe Device, type: :model do
let(:device) { create(:device) }
it { should validate_presence_of :unique_id }
it { should validate_presence_of :model }
it { should validate_uniqueness_of :unique_id }
describe "before create" do
it "generates an access token for the device" do
expect(device.access_token).not_to be_nil
end
end
end