cartodb-4.42/spec/factories/user_creations.rb

26 lines
694 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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