Basic FASP support (#34031)
This commit is contained in:
parent
e5fd61a84e
commit
97b9994743
45 changed files with 1423 additions and 1 deletions
39
spec/system/admin/fasp/registrations_spec.rb
Normal file
39
spec/system/admin/fasp/registrations_spec.rb
Normal file
|
@ -0,0 +1,39 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'FASP registration', feature: :fasp do
|
||||
include ProviderRequestHelper
|
||||
|
||||
before { sign_in Fabricate(:admin_user) }
|
||||
|
||||
describe 'Confirming an unconfirmed FASP' do
|
||||
let(:provider) { Fabricate(:fasp_provider, confirmed: false) }
|
||||
|
||||
before do
|
||||
stub_provider_request(provider,
|
||||
path: '/provider_info',
|
||||
response_body: {
|
||||
capabilities: [
|
||||
{ id: 'debug', version: '0.1' },
|
||||
],
|
||||
contactEmail: 'newcontact@example.com',
|
||||
fediverseAccount: '@newfedi@social.example.com',
|
||||
privacyPolicy: 'https::///example.com/privacy',
|
||||
signInUrl: 'https://myprov.example.com/sign_in',
|
||||
})
|
||||
end
|
||||
|
||||
it 'displays key fingerprint and updates the provider on confirmation' do
|
||||
visit new_admin_fasp_provider_registration_path(provider)
|
||||
|
||||
expect(page).to have_css('code', text: provider.provider_public_key_fingerprint)
|
||||
|
||||
click_on I18n.t('admin.fasp.providers.registrations.confirm')
|
||||
|
||||
expect(page).to have_css('h2', text: I18n.t('admin.fasp.providers.edit'))
|
||||
|
||||
expect(provider.reload).to be_confirmed
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue