From b6d14dc19dd350a807826e3e097738a36613e083 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 8 Apr 2014 11:49:14 +0200 Subject: moving users: app and test files --- test/factories.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test/factories.rb') diff --git a/test/factories.rb b/test/factories.rb index 6c671f8..98bb39b 100644 --- a/test/factories.rb +++ b/test/factories.rb @@ -1,3 +1,37 @@ Dir.glob(Rails.root.join('**','test','factories.rb')) do |factory_file| require factory_file end +FactoryGirl.define do + + factory :user do + login { Faker::Internet.user_name } + password_verifier "1234ABCD" + password_salt "4321AB" + + factory :user_with_settings do + email_forward { Faker::Internet.email } + email_aliases_attributes do + {:a => Faker::Internet.user_name + '@' + APP_CONFIG[:domain]} + end + end + + factory :admin_user do + after(:build) do |admin| + admin.stubs(:is_admin?).returns(true) + end + end + end + + factory :token do + user + end + + factory :pgp_key do + keyblock <<-EOPGP +-----BEGIN PGP PUBLIC KEY BLOCK----- ++Dummy+PGP+KEY+++Dummy+PGP+KEY+++Dummy+PGP+KEY+++Dummy+PGP+KEY+ +#{SecureRandom.base64(4032)} +-----END PGP PUBLIC KEY BLOCK----- + EOPGP + end +end -- cgit v1.2.3 From 20197129459d90642c50c27e601ef13ece4a873b Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 8 Apr 2014 14:30:57 +0200 Subject: only load */test/factories from test/factories prevent recursive loadign of test/factories.rb ** can be empty. --- test/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/factories.rb') diff --git a/test/factories.rb b/test/factories.rb index 98bb39b..980e2aa 100644 --- a/test/factories.rb +++ b/test/factories.rb @@ -1,4 +1,4 @@ -Dir.glob(Rails.root.join('**','test','factories.rb')) do |factory_file| +Dir.glob(Rails.root.join('*','test','factories.rb')) do |factory_file| require factory_file end FactoryGirl.define do -- cgit v1.2.3 From 636692f9921bd695d726695d2d46c91f5a6e56f3 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 11 Apr 2014 10:03:19 +0200 Subject: move engines into engines directory Also renamed help to support so it's harder to confuse it with documentation --- test/factories.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/factories.rb') diff --git a/test/factories.rb b/test/factories.rb index 980e2aa..ac9333c 100644 --- a/test/factories.rb +++ b/test/factories.rb @@ -1,6 +1,8 @@ -Dir.glob(Rails.root.join('*','test','factories.rb')) do |factory_file| +ENGINE_FACTORY_FILES = Rails.root.join('engines','*','test','factories.rb') +Dir.glob(ENGINE_FACTORY_FILES) do |factory_file| require factory_file end + FactoryGirl.define do factory :user do -- cgit v1.2.3