diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-07-24 23:45:12 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-07-27 19:09:46 +0300 |
commit | e561b142fa7c9dd636fd056fc0a6c84961d0cd46 (patch) | |
tree | 10e34698af1d5a3647840faee470e6047b782e30 /spec/controllers/admin | |
parent | 9981814514742a2ee507d4dcc2fd71099fd96585 (diff) |
Backport gitlab-ee!2456
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r-- | spec/controllers/admin/applications_controller_spec.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/controllers/admin/applications_controller_spec.rb b/spec/controllers/admin/applications_controller_spec.rb index e311b8a63b2..7bd6c0e6117 100644 --- a/spec/controllers/admin/applications_controller_spec.rb +++ b/spec/controllers/admin/applications_controller_spec.rb @@ -28,13 +28,16 @@ describe Admin::ApplicationsController do describe 'POST #create' do it 'creates the application' do + create_params = attributes_for(:application, trusted: true) + expect do - post :create, doorkeeper_application: attributes_for(:application) + post :create, doorkeeper_application: create_params end.to change { Doorkeeper::Application.count }.by(1) application = Doorkeeper::Application.last expect(response).to redirect_to(admin_application_path(application)) + expect(application).to have_attributes(create_params.except(:uid, :owner_type)) end it 'renders the application form on errors' do @@ -49,10 +52,12 @@ describe Admin::ApplicationsController do describe 'PATCH #update' do it 'updates the application' do - patch :update, id: application.id, doorkeeper_application: { redirect_uri: 'http://example.com/' } + patch :update, id: application.id, doorkeeper_application: { redirect_uri: 'http://example.com/', trusted: true } + + application.reload expect(response).to redirect_to(admin_application_path(application)) - expect(application.reload.redirect_uri).to eq 'http://example.com/' + expect(application).to have_attributes(redirect_uri: 'http://example.com/', trusted: true) end it 'renders the application form on errors' do |