Can be useful in generating random cell numbers while writing specs for a class which has a Cell Number attribute.
FactoryGirl.define do
sequence :cell_number do |n|
# ---------------------------------------- ----------------------
#| SUFFIX PART | | PREFIX PART |
9.times.map { (0..9).to_a.sample }.join("").prepend([7, 8, 9].sample.to_s)
end
end
Sample Output
7119156645