mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Remove I18n keys in User ctrllers spec
This commit is contained in:
@@ -67,7 +67,7 @@ describe UserConfirmationsController, type: :controller do
|
||||
it "redirects the user to login" do
|
||||
spree_post :create, spree_user: { email: unconfirmed_user.email }
|
||||
expect(response).to redirect_to login_path
|
||||
expect(flash[:success]).to eq I18n.t('devise.user_confirmations.spree_user.confirmation_sent')
|
||||
expect(flash[:success]).to eq 'Email confirmation sent'
|
||||
end
|
||||
|
||||
it "sends the confirmation email" do
|
||||
|
||||
@@ -16,19 +16,21 @@ describe UserPasswordsController, type: :controller do
|
||||
it "returns 404 if user is not found" do
|
||||
spree_post :create, spree_user: { email: "xxxxxxxxxx@example.com" }
|
||||
expect(response.status).to eq 404
|
||||
expect(response.body).to match I18n.t(:email_not_found)
|
||||
expect(response.body).to match 'Email address not found'
|
||||
end
|
||||
|
||||
it "returns 422 if user is registered but not confirmed" do
|
||||
spree_post :create, spree_user: { email: unconfirmed_user.email }
|
||||
expect(response.status).to eq 422
|
||||
expect(response.body).to match I18n.t(:email_unconfirmed)
|
||||
expect(response.body).to match "You must confirm your email \
|
||||
address before you can reset your password."
|
||||
end
|
||||
|
||||
it "returns 200 when password reset was successful" do
|
||||
spree_post :create, spree_user: { email: user.email }
|
||||
expect(response.status).to eq 200
|
||||
expect(response.body).to match I18n.t(:password_reset_sent)
|
||||
expect(response.body).to match "An email with instructions on resetting \
|
||||
your password has been sent!"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -39,7 +39,10 @@ describe UserRegistrationsController, type: :controller do
|
||||
|
||||
expect(response.status).to eq(401)
|
||||
json = JSON.parse(response.body)
|
||||
expect(json).to eq("message" => I18n.t('devise.user_registrations.spree_user.unknown_error'))
|
||||
expect(json).to eq(
|
||||
"message" =>
|
||||
'Something went wrong while creating your account. Check your email address and try again.'
|
||||
)
|
||||
end
|
||||
|
||||
it "returns 200 when registration succeeds" do
|
||||
|
||||
Reference in New Issue
Block a user