<commit_before>Factory.sequence :email do |n|
  "<EMAIL>"
end
Factory.sequence :token do |n|
  "<KEY>n}"
end

Factory.define :user do |u|
  u.email { Factory.next(:email) }
  u.password "<PASSWORD>"
  u.password_confirmation {|u| u.password}
  u.single_access_token { Factory.next(:token) }
end

Factory.define :top_level_folder , :class => Folder do |p|
  p.title "Global Nav"
  p.state 'published'
  p.locked true
  p.position 1
end

Factory.define :folder , :class => Folder do |p|
  p.title "Folder"
end

Factory.define :page, :class => BasicPage do |p|
  p.title "About Us"
  p.position 1
  p.association :parent, :factory => :top_level_folder
  p.intro Faker::Lorem.sentence(10)
  p.body "<p>" + Faker::Lorem.paragraphs(2).join("</p>\n<p>") + "</p>"
end

Factory.define :published_page, :parent => :page do |p|
  p.state 'published'
  p.visible true
end


Factory.define :file_upload do |f|
  f.title "File Title"
  f.file { File.open( File.join(CmsEngine::ROOT,'spec/fixtures/files/test.xls')) }
end

Factory.define :image do |f|
  f.file { File.open( File.join(CmsEngine::ROOT,'spec/fixtures/images/mm.jpg')) }
end
<commit_msg>Changed factories to support faker 0.9.5<commit_after>Factory.sequence :email do |n|
  "<EMAIL>"
end
Factory.sequence :token do |n|
  "<KEY>}"
end

Factory.define :user do |u|
  u.email { Factory.next(:email) }
  u.password "<PASSWORD>"
  u.password_confirmation {|u| <PASSWORD>}
  u.single_access_token { Factory.next(:token) }
end

Factory.define :top_level_folder , :class => Folder do |p|
  p.title "Global Nav"
  p.state 'published'
  p.locked true
  p.position 1
end

Factory.define :folder , :class => Folder do |p|
  p.title "Folder"
end

Factory.define :page, :class => BasicPage do |p|
  p.title "About Us"
  p.position 1
  p.association :parent, :factory => :top_level_folder
  p.intro 'Test'
  p.body "<p>" + 'Test' + "</p>"
end

Factory.define :published_page, :parent => :page do |p|
  p.state 'published'
  p.visible true
end


Factory.define :file_upload do |f|
  f.title "File Title"
  f.file { File.open( File.join(CmsEngine::ROOT,'spec/fixtures/files/test.xls')) }
end

Factory.define :image do |f|
  f.file { File.open( File.join(CmsEngine::ROOT,'spec/fixtures/images/mm.jpg')) }
end

{'fraction_non_alphanumeric': 0.16257257704332292, 'fraction_numerical': 0.0044662795891022775, 'mean_word_length': 4.090909090909091, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4198394', 'n_tokens_mistral': 857, 'n_tokens_neox': 849, 'n_words': 211}