gitlab-org--gitlab-foss/spec/models/personal_access_token_spec.rb
2016-06-03 10:11:36 +05:30

15 lines
433 B
Ruby

require 'spec_helper'
describe PersonalAccessToken, models: true do
describe ".generate" do
it "generates a random token" do
personal_access_token = PersonalAccessToken.generate({})
expect(personal_access_token.token).to be_present
end
it "doesn't save the record" do
personal_access_token = PersonalAccessToken.generate({})
expect(personal_access_token).not_to be_persisted
end
end
end