Fix redirect after creating a user in spec

This commit is contained in:
Eugene Burmakin 2024-11-08 21:28:45 +01:00
parent b97b30c88a
commit abf46a7436
2 changed files with 2 additions and 1 deletions

View file

@ -1,6 +1,7 @@
# frozen_string_literal: true
class Settings::UsersController < ApplicationController
before_action :authenticate_user!
before_action :authenticate_admin!
def index

View file

@ -40,7 +40,7 @@ RSpec.describe '/settings/users', type: :request do
it 'redirects to the created settings_user' do
post settings_users_url, params: { user: valid_attributes }
expect(response).to redirect_to(settings_url)
expect(response).to redirect_to(settings_users_url)
expect(flash[:notice]).to eq("User was successfully created, email is #{valid_attributes[:email]}, password is \"password\".")
end
end