mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #5223 from luisramos0/def_user
Change default user from spree@example.com to ofn@example.com ❤️
This commit is contained in:
@@ -60,10 +60,10 @@ Now, your dreams of spinning up a development server can be realised:
|
||||
|
||||
bundle exec rails server
|
||||
|
||||
To login as Spree default user, use:
|
||||
To login as the default user, use:
|
||||
|
||||
email: spree@example.com
|
||||
password: spree123
|
||||
email: ofn@example.com
|
||||
password: ofn123
|
||||
|
||||
### Testing
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ def prompt_for_admin_password
|
||||
password = ENV['ADMIN_PASSWORD'].dup
|
||||
say "Admin Password #{password}"
|
||||
else
|
||||
password = ask('Password [spree123]: ') do |q|
|
||||
password = ask('Password [ofn123]: ') do |q|
|
||||
q.echo = false
|
||||
q.validate = /^(|.{5,40})$/
|
||||
q.responses[:not_valid] = 'Invalid password. Must be at least 5 characters long.'
|
||||
q.whitespace = :strip
|
||||
end
|
||||
password = 'spree123' if password.blank?
|
||||
password = 'ofn123' if password.blank?
|
||||
end
|
||||
|
||||
password
|
||||
@@ -23,11 +23,11 @@ def prompt_for_admin_email
|
||||
email = ENV['ADMIN_EMAIL'].dup
|
||||
say "Admin User #{email}"
|
||||
else
|
||||
email = ask('Email [spree@example.com]: ') do |q|
|
||||
email = ask('Email [ofn@example.com]: ') do |q|
|
||||
q.echo = true
|
||||
q.whitespace = :strip
|
||||
end
|
||||
email = 'spree@example.com' if email.blank?
|
||||
email = 'ofn@example.com' if email.blank?
|
||||
end
|
||||
|
||||
email
|
||||
@@ -35,8 +35,8 @@ end
|
||||
|
||||
def create_admin_user
|
||||
if ENV.fetch("AUTO_ACCEPT", true)
|
||||
password = ENV.fetch("ADMIN_PASSWORD", "spree123").dup
|
||||
email = ENV.fetch("ADMIN_EMAIL", "spree@example.com").dup
|
||||
password = ENV.fetch("ADMIN_PASSWORD", "ofn123").dup
|
||||
email = ENV.fetch("ADMIN_EMAIL", "ofn@example.com").dup
|
||||
else
|
||||
puts 'Create the admin user (press enter for defaults).'
|
||||
#name = prompt_for_admin_name unless name
|
||||
|
||||
@@ -24,8 +24,6 @@ services:
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
ADMIN_EMAIL: ofn@example.com
|
||||
ADMIN_PASSWORD: ofn123
|
||||
OFN_DB_HOST: db
|
||||
command: >
|
||||
bash -c "wait-for-it -t 30 db:5432 &&
|
||||
|
||||
@@ -4,7 +4,7 @@ module Spree
|
||||
module Setup
|
||||
def sign_in_as_user!
|
||||
let!(:current_api_user) do
|
||||
user = Spree::LegacyUser.new(email: "spree@example.com")
|
||||
user = Spree::LegacyUser.new(email: "ofn@example.com")
|
||||
user.stub(:has_spree_role?).with("admin").and_return(false)
|
||||
user.stub(:enterprises) { [] }
|
||||
user.stub(:owned_groups) { [] }
|
||||
@@ -31,7 +31,7 @@ module Spree
|
||||
|
||||
def sign_in_as_admin!
|
||||
let!(:current_api_user) do
|
||||
user = Spree::LegacyUser.new(email: "spree@example.com")
|
||||
user = Spree::LegacyUser.new(email: "ofn@example.com")
|
||||
user.stub(:has_spree_role?).with("admin").and_return(true)
|
||||
|
||||
# Stub enterprises, needed for cancan ability checks
|
||||
|
||||
@@ -54,7 +54,7 @@ if [ ! -f config/newrelic.yml ]; then
|
||||
fi
|
||||
|
||||
# Set up the database for both development and test
|
||||
# Confirming the default user and password Spree prompts
|
||||
# Confirming the default user and password
|
||||
printf '\n\n' | bundle exec rake db:setup db:test:prepare
|
||||
printf '\n'
|
||||
|
||||
@@ -65,8 +65,8 @@ printf '\n'
|
||||
printf "${YELLOW}WELCOME TO OPEN FOOD NETWORK!\n"
|
||||
printf '\n'
|
||||
|
||||
printf "To login as the Spree default user, use:"
|
||||
printf "To login as the default user, use:"
|
||||
printf '\n'
|
||||
printf '\n'
|
||||
printf ' email: spree@example.com\n'
|
||||
printf " password: spree123\n${NO_COLOR}"
|
||||
printf ' email: ofn@example.com\n'
|
||||
printf " password: ofn123\n${NO_COLOR}"
|
||||
|
||||
@@ -15,7 +15,7 @@ describe Api::BaseController do
|
||||
context "signed in as a user using an authentication extension" do
|
||||
before do
|
||||
allow(controller).to receive_messages try_spree_current_user:
|
||||
double(email: "spree@example.com")
|
||||
double(email: "ofn@example.com")
|
||||
end
|
||||
|
||||
it "can make a request" do
|
||||
|
||||
@@ -131,7 +131,7 @@ describe Api::ShipmentsController, type: :controller do
|
||||
before do
|
||||
allow_any_instance_of(Spree::Order).to receive_messages(paid?: true, complete?: true)
|
||||
# For the shipment notification email
|
||||
Spree::Config[:mails_from] = "spree@example.com"
|
||||
Spree::Config[:mails_from] = "ofn@example.com"
|
||||
|
||||
shipment.update!(shipment.order)
|
||||
expect(shipment.state).to eq("ready")
|
||||
|
||||
@@ -8,13 +8,13 @@ describe Spree::Admin::MailMethodsController do
|
||||
context "#update" do
|
||||
it "should reinitialize the mail settings" do
|
||||
expect(Spree::Core::MailSettings).to receive(:init)
|
||||
spree_put :update, enable_mail_delivery: "1", mails_from: "spree@example.com"
|
||||
spree_put :update, enable_mail_delivery: "1", mails_from: "ofn@example.com"
|
||||
end
|
||||
end
|
||||
|
||||
it "can trigger testmail" do
|
||||
request.env["HTTP_REFERER"] = "/"
|
||||
user = double('User', email: 'user@spree.com',
|
||||
user = double('User', email: 'user@example.com',
|
||||
spree_api_key: 'fake',
|
||||
id: nil,
|
||||
owned_groups: nil)
|
||||
|
||||
@@ -15,7 +15,7 @@ describe "Mail Methods" do
|
||||
end
|
||||
|
||||
it "should be able to edit mail method settings" do
|
||||
fill_in "mail_bcc", with: "spree@example.com99"
|
||||
fill_in "mail_bcc", with: "ofn@example.com"
|
||||
click_button "Update"
|
||||
expect(page).to have_content("successfully updated!")
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def current_api_user
|
||||
@current_api_user ||= Spree::LegacyUser.new(email: "spree@example.com", enterprises: [])
|
||||
@current_api_user ||= Spree::LegacyUser.new(email: "ofn@example.com", enterprises: [])
|
||||
end
|
||||
|
||||
def assert_unauthorized!
|
||||
|
||||
Reference in New Issue
Block a user