make fake data

This commit is contained in:
Rueshyna 2012-11-22 16:34:20 +08:00
parent e453cfce9c
commit 645f25d446
4 changed files with 23 additions and 2 deletions

View File

@ -76,7 +76,8 @@ group :test, :development do
gem 'pry-remote' gem 'pry-remote'
gem 'pry-stack_explorer' gem 'pry-stack_explorer'
gem 'pry-debugger' gem 'pry-debugger'
gem 'faker'
gem "sunspot-rails-tester" gem "sunspot-rails-tester"
gem 'spork' gem 'spork'
gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing. gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing.

View File

@ -1,5 +1,6 @@
orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ // this init journal papers orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ // this init journal papers
this.initializeJournalPapers.formCallback = function(data){ this.initializeJournalPapers.formCallback = function(data){
if(data.success){
o.notify(data.msg,"success"); o.notify(data.msg,"success");
o.sub_menu_item($("div[content-type=menu] a").eq(0)); o.sub_menu_item($("div[content-type=menu] a").eq(0));
}else{ }else{

View File

@ -2,7 +2,7 @@ defaults: &defaults
host: localhost host: localhost
# slaves: # slaves:
# - host: slave1.local # - host: slave1.local
port: 37017 port: 27017
# - host: slave2.local # - host: slave2.local
# port: 27019 # port: 27019

View File

@ -32,3 +32,22 @@ end
FactoryGirl.create(:custom_record, journal_title_translations: {zh_tw: "tw_test A", en: "en_test A"}) FactoryGirl.create(:custom_record, journal_title_translations: {zh_tw: "tw_test A", en: "en_test A"})
FactoryGirl.create(:custom_record, journal_title_translations: {zh_tw: "tw_test B", en: "en_test B"}) FactoryGirl.create(:custom_record, journal_title_translations: {zh_tw: "tw_test B", en: "en_test B"})
abstract_file = "./icml2011_abstract"
abstracts = File.open(file).readlines
bibtex_file = "./icml2011.bibtex"
bibtex = File.open(file).readlines
FactoryGirl.define do
factory :paper_record, class: "WritingJournal" do |f|
f.sequence(:paper_title_translations) {|n|{zh_tw: "[tw]_test #{n}", en: "en_test #{n}" }}
f.sequence(:journal_title_translations) {|n| {zh_tw: "tw_test #{n}", en: "en_test #{n}"}}
f.sequence(:keywords) {|n| "keywords #{n}"}
f.sequence(:abstract) {|n| "abstract #{n}"}
f.sequence(:isbn) {|n| "0714312#{n}#{n}#{n}"}
f.sequence(:year) {|n| "201#{n}"}
f.create_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
f.update_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
end
end