mirror of
http://ghproxy.cn/https://github.com/multunus/onemdm-server
synced 2025-12-06 10:14:59 +00:00
- with attributes: model, imei_number, unique_id and access_token - access_token is automatically generated on create
16 lines
390 B
Ruby
16 lines
390 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 "after create" do
|
|
it "generates an access token for the device" do
|
|
expect(device.access_token).not_to be_nil
|
|
end
|
|
end
|
|
end
|