Skip to content

Commit

Permalink
Maintenance: Added test for token user preferences.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed May 24, 2024
1 parent 8de8c73 commit a174e95
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/system/apps/desktop/account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@
end
end

describe 'token handling' do
let(:agent) { create(:admin) }

it 'user can create and use a token' do
click_on 'Profile settings'
click_on 'Token Access'

click_on 'New Personal Access Token'

fill_in 'Name', with: 'Test Token'

# Activate some permissions for the token
find('span', text: 'Configure your system.').click
find('span', text: 'Manage personal settings.').click

click_on 'Create'
wait_for_mutation('userCurrentAccessTokenAdd')

expect(Token.last.name).to eq('Test Token')
expect(Token.last.permissions.map(&:name)).to eq(%w[admin user_preferences])
expect(Token.last.check?).to be(true)
end
end

describe 'avatar handling', authenticated_as: :agent do
let(:agent) { create(:agent, firstname: 'Jane', lastname: 'Doe') }

Expand Down

0 comments on commit a174e95

Please sign in to comment.