Automatically confirm the spree@example.com user

This allows you to log in with it after you run `bundle exec
openfoodnetwork:dev:load_sample_data` rake task right away.
This commit is contained in:
Pau Perez
2018-03-06 15:25:58 +01:00
parent 23d36e3898
commit ae2eba89ca

View File

@@ -9,9 +9,11 @@ namespace :openfoodnetwork do
require_relative '../../spec/support/spree/init'
task_name = "openfoodnetwork:dev:load_sample_data"
spree_user = Spree::User.find_by_email('spree@example.com')
Spree::MailMethod.create!(
environment: Rails.env,
preferred_mails_from: 'spree@example.com'
preferred_mails_from: spree_user.email
)
# -- Shipping / payment information
@@ -193,6 +195,8 @@ namespace :openfoodnetwork do
CreateOrderCycle.new(enterprise2, variants).call
EnterpriseRole.create!(user: Spree::User.first, enterprise: enterprise2)
spree_user.confirm!
end
# Creates an order cycle for the provided enterprise and selecting all the