diff options
Diffstat (limited to 'spec/features/profiles/user_manages_applications_spec.rb')
-rw-r--r-- | spec/features/profiles/user_manages_applications_spec.rb | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/spec/features/profiles/user_manages_applications_spec.rb b/spec/features/profiles/user_manages_applications_spec.rb index 22eed748c00..c76ef2613fd 100644 --- a/spec/features/profiles/user_manages_applications_spec.rb +++ b/spec/features/profiles/user_manages_applications_spec.rb @@ -3,55 +3,12 @@ require 'spec_helper' RSpec.describe 'User manages applications' do - let(:user) { create(:user) } + let_it_be(:user) { create(:user) } + let_it_be(:new_application_path) { applications_profile_path } before do sign_in(user) - visit applications_profile_path end - it 'manages applications' do - expect(page).to have_content 'Add new application' - - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - check :doorkeeper_application_scopes_read_user - click_on 'Save application' - - expect(page).to have_content 'Application: test' - expect(page).to have_content 'Application ID' - expect(page).to have_content 'Secret' - expect(page).to have_content 'Confidential Yes' - - click_on 'Edit' - - expect(page).to have_content 'Edit application' - fill_in :doorkeeper_application_name, with: 'test_changed' - uncheck :doorkeeper_application_confidential - click_on 'Save application' - - expect(page).to have_content 'test_changed' - expect(page).to have_content 'Application ID' - expect(page).to have_content 'Secret' - expect(page).to have_content 'Confidential No' - - visit applications_profile_path - - page.within '.oauth-applications' do - click_on 'Destroy' - end - expect(page.find('.oauth-applications')).not_to have_content 'test_changed' - end - - context 'when scopes are blank' do - it 'returns an error' do - expect(page).to have_content 'Add new application' - - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - click_on 'Save application' - - expect(page).to have_content("Scopes can't be blank") - end - end + include_examples 'manage applications' end |