Merge remote-tracking branch 'parent/main' into upstream-20240731
This commit is contained in:
commit
8b09a57a91
320 changed files with 3132 additions and 1643 deletions
|
@ -9,6 +9,43 @@ RSpec.describe Admin::TagsController do
|
|||
sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin'))
|
||||
end
|
||||
|
||||
describe 'GET #index' do
|
||||
before do
|
||||
Fabricate(:tag)
|
||||
|
||||
tag_filter = instance_double(Admin::TagFilter, results: Tag.all)
|
||||
allow(Admin::TagFilter).to receive(:new).and_return(tag_filter)
|
||||
end
|
||||
|
||||
let(:params) { { order: 'newest' } }
|
||||
|
||||
it 'returns http success' do
|
||||
get :index
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response).to render_template(:index)
|
||||
|
||||
expect(Admin::TagFilter)
|
||||
.to have_received(:new)
|
||||
.with(hash_including(params))
|
||||
end
|
||||
|
||||
describe 'with filters' do
|
||||
let(:params) { { order: 'newest', name: 'test' } }
|
||||
|
||||
it 'returns http success' do
|
||||
get :index, params: { name: 'test' }
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response).to render_template(:index)
|
||||
|
||||
expect(Admin::TagFilter)
|
||||
.to have_received(:new)
|
||||
.with(hash_including(params))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET #show' do
|
||||
let!(:tag) { Fabricate(:tag) }
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Oauth::AuthorizationsController do
|
||||
render_views
|
||||
|
||||
let(:app) { Doorkeeper::Application.create!(name: 'test', redirect_uri: 'http://localhost/', scopes: 'read') }
|
||||
|
||||
describe 'GET #new' do
|
||||
|
@ -36,11 +34,6 @@ RSpec.describe Oauth::AuthorizationsController do
|
|||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
end
|
||||
|
||||
it 'gives options to authorize and deny' do
|
||||
subject
|
||||
expect(response.body).to match(/Authorize/)
|
||||
end
|
||||
|
||||
include_examples 'stores location for user'
|
||||
|
||||
context 'when app is already authorized' do
|
||||
|
@ -61,7 +54,8 @@ RSpec.describe Oauth::AuthorizationsController do
|
|||
|
||||
it 'does not redirect to callback with force_login=true' do
|
||||
get :new, params: { client_id: app.uid, response_type: 'code', redirect_uri: 'http://localhost/', scope: 'read', force_login: 'true' }
|
||||
expect(response.body).to match(/Authorize/)
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue