From 86bebaf71cfadda391ad3b9a248ce3f73172ebeb Mon Sep 17 00:00:00 2001 From: ccx1024cc <1261138729@qq.com> Date: Thu, 15 Dec 2016 09:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=9A=8F=E6=9C=BA=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/factories/factory_helper.rb | 3 --- spec/factories/projects.rb | 2 +- spec/factories/users.rb | 2 +- spec/rails_helper.rb | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 spec/factories/factory_helper.rb diff --git a/spec/factories/factory_helper.rb b/spec/factories/factory_helper.rb deleted file mode 100644 index 2fc678b..0000000 --- a/spec/factories/factory_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -def generateRandomString(min_len, max_len) - Faker::Internet.password(min_len, max_len) -end \ No newline at end of file diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index c825125..0e3486c 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -8,7 +8,7 @@ FactoryGirl.define do end factory :project_name_length_gt_20 do - name { generateRandomString(51, 51)} + name { Faker::Internet.password(51, 51) } end end end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 82f3993..641503b 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -11,7 +11,7 @@ FactoryGirl.define do end factory :user_name_length_gt_30 do - name generateRandomString(31, 31) + name Faker::Internet.password(31, 31) end factory :user_email_length_gt_50 do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index bc7e441..6f1ab14 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -5,7 +5,6 @@ require File.expand_path('../../config/environment', __FILE__) abort("The Rails environment is running in production mode!") if Rails.env.production? require 'spec_helper' require 'rspec/rails' -require 'factories/factory_helper' # 添加预固件辅助器 # Add additional requires below this line. Rails is not loaded until this point! # Requires supporting ruby files with custom matchers and macros, etc, in