metamaps--metamaps/spec/models/token_spec.rb

11 lines
284 B
Ruby
Raw Permalink Normal View History

require 'rails_helper'
RSpec.describe Token, type: :model do
2016-03-13 08:20:18 +00:00
context "#generate_token" do
subject (:token) { Token.new }
it "should generate an alphanumeric token of 32 characters" do
2016-03-13 20:28:07 +00:00
expect(token.send(:generate_token)).to match /^[a-zA-Z0-9]{32}$/
2016-03-13 08:20:18 +00:00
end
end
end