CI / Test (push) Successful in 44s
Users with stored remoteStorage authorizations now jump straight to the connected apps dashboard from the services dashboard, instead of the storage info page.
41 lines
1.2 KiB
Ruby
41 lines
1.2 KiB
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe 'Account dashboard', type: :feature do
|
|
let(:user) { create :user }
|
|
|
|
before do
|
|
login_as user, :scope => :user
|
|
end
|
|
|
|
scenario 'View dashboard' do
|
|
visit root_path
|
|
expect(page).to have_content('Services')
|
|
end
|
|
|
|
context 'with connected remoteStorage apps' do
|
|
before do
|
|
allow_any_instance_of(AppCatalog::WebApp).to receive(:update_metadata).and_return(true)
|
|
allow_any_instance_of(RemoteStorageAuthorization).to receive(:remove_token_expiry_job).and_return(nil)
|
|
|
|
user.remote_storage_authorizations.create!(
|
|
permissions: ["documents:rw"],
|
|
client_id: "app.example.com",
|
|
redirect_uri: "https://app.example.com",
|
|
expire_at: 1.month.from_now
|
|
)
|
|
end
|
|
|
|
scenario 'links the Storage card to the connected apps dashboard' do
|
|
visit root_path
|
|
expect(page).to have_link('Storage', href: apps_services_storage_path)
|
|
end
|
|
end
|
|
|
|
context 'without connected remoteStorage apps' do
|
|
scenario 'links the Storage card to the storage info page' do
|
|
visit root_path
|
|
expect(page).to have_link('Storage', href: services_storage_path)
|
|
end
|
|
end
|
|
end
|