Merge remote-tracking branch 'parent/main' into upstream-20240117
This commit is contained in:
commit
5d79bd078c
150 changed files with 2982 additions and 1485 deletions
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Admin::FollowRecommendationsController do
|
||||
render_views
|
||||
|
||||
let(:user) { Fabricate(:admin_user) }
|
||||
|
||||
before do
|
||||
sign_in user, scope: :user
|
||||
end
|
||||
|
||||
describe 'GET #show' do
|
||||
it 'returns http success' do
|
||||
get :show
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Admin::TermsOfService::HistoriesController do
|
||||
render_views
|
||||
|
||||
let(:user) { Fabricate(:admin_user) }
|
||||
|
||||
before do
|
||||
sign_in user, scope: :user
|
||||
end
|
||||
|
||||
describe 'GET #show' do
|
||||
it 'returns http success' do
|
||||
get :show
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -3,6 +3,8 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ApplicationController do
|
||||
render_views
|
||||
|
||||
controller do
|
||||
def success
|
||||
head 200
|
||||
|
@ -23,9 +25,22 @@ RSpec.describe ApplicationController do
|
|||
|
||||
shared_examples 'respond_with_error' do |code|
|
||||
it "returns http #{code} for http and renders template" do
|
||||
expect(subject).to render_template("errors/#{code}", layout: 'error')
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(code)
|
||||
expect(response)
|
||||
.to have_http_status(code)
|
||||
expect(response.parsed_body)
|
||||
.to have_css('body[class=error]')
|
||||
expect(response.parsed_body.css('h1').to_s)
|
||||
.to include(error_content(code))
|
||||
end
|
||||
|
||||
def error_content(code)
|
||||
if code == 422
|
||||
I18n.t('errors.422.content')
|
||||
else
|
||||
I18n.t("errors.#{code}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Auth::SetupController do
|
||||
render_views
|
||||
|
||||
describe 'GET #show' do
|
||||
context 'with a signed out request' do
|
||||
it 'returns http redirect' do
|
||||
get :show
|
||||
expect(response).to be_redirect
|
||||
end
|
||||
end
|
||||
|
||||
context 'with an unconfirmed signed in user' do
|
||||
before { sign_in Fabricate(:user, confirmed_at: nil) }
|
||||
|
||||
it 'returns http success' do
|
||||
get :show
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue