cartodb-4.29/spec/factories/user_creations.rb
2020-06-15 10:58:47 +08:00

26 lines
694 B
Ruby

require 'ostruct'
FactoryGirl.define do
factory :user_creation, class: Carto::UserCreation do
username "whatever"
email "whatever@carto.com"
crypted_password "rgjreogjorejgpovrjeg"
google_sign_in false
quota_in_bytes 10000000
soft_twitter_datasource_limit false
factory :autologin_user_creation do
state 'success'
created_at { Time.now }
after(:build) do |model, evaluator|
# This is useful to test user creation logic without persistence
fake_user = OpenStruct.new(enable_account_token: nil, enabled: true, dashboard_viewed_at: nil)
model.instance_variable_set(:@cartodb_user, fake_user)
end
end
end
end