2016-09-24 03:00:46 +00:00
|
|
|
# frozen_string_literal: true
|
2016-03-11 06:16:04 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe Token, type: :model do
|
2016-07-26 00:14:23 +00:00
|
|
|
context '#generate_token' do
|
|
|
|
subject(:token) { Token.new }
|
|
|
|
it 'should generate an alphanumeric token of 32 characters' do
|
|
|
|
expect(token.send(:generate_token)).to match(/^[a-zA-Z0-9]{32}$/)
|
2016-03-13 08:20:18 +00:00
|
|
|
end
|
|
|
|
end
|
2016-03-11 06:16:04 +00:00
|
|
|
end
|