diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-14 18:26:09 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-14 18:26:09 +0300 |
commit | dd9ced0af9514c0cf511c8f0f10d19c014fa4d19 (patch) | |
tree | 8e2e8c380969bde9b96993bbfdc7791ce47f2b10 /spec/factories | |
parent | 4a514b27e96bfa6024e26b0a7500deec1d89391b (diff) | |
parent | e450892f5688529b8a49e3ae7598f00dbdda7161 (diff) |
Merge branch 'connorshea/gitlab-ce-revoke-authorized-application' into 'master'
Fix revoking of authorized OAuth applications
Users were not able to revoke access to authorized OAuth applications. Clicking the "Revoke" button would result in a 404 page, and the application would still be authorized.
Added a spec and also found that the `gon` variables were not being set for this view.
Closes #14370
See merge request !3690
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/oauth_access_tokens.rb | 22 | ||||
-rw-r--r-- | spec/factories/oauth_applications.rb | 9 | ||||
-rw-r--r-- | spec/factories/users.rb | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/spec/factories/oauth_access_tokens.rb b/spec/factories/oauth_access_tokens.rb new file mode 100644 index 00000000000..7700b15d538 --- /dev/null +++ b/spec/factories/oauth_access_tokens.rb @@ -0,0 +1,22 @@ +# == Schema Information +# +# Table name: oauth_access_tokens +# +# id :integer not null, primary key +# resource_owner_id :integer +# application_id :integer +# token :string not null +# refresh_token :string +# expires_in :integer +# revoked_at :datetime +# created_at :datetime not null +# scopes :string +# + +FactoryGirl.define do + factory :oauth_access_token do + resource_owner + application + token '123456' + end +end diff --git a/spec/factories/oauth_applications.rb b/spec/factories/oauth_applications.rb new file mode 100644 index 00000000000..d116a573830 --- /dev/null +++ b/spec/factories/oauth_applications.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :oauth_application, class: 'Doorkeeper::Application', aliases: [:application] do + name { FFaker::Name.name } + uid { FFaker::Name.name } + redirect_uri { FFaker::Internet.uri('http') } + owner + owner_type 'User' + end +end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index a5c60c51c5b..a9b2148bd2a 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,7 +1,7 @@ FactoryGirl.define do sequence(:name) { FFaker::Name.name } - factory :user, aliases: [:author, :assignee, :recipient, :owner, :creator] do + factory :user, aliases: [:author, :assignee, :recipient, :owner, :creator, :resource_owner] do email { FFaker::Internet.email } name sequence(:username) { |n| "#{FFaker::Internet.user_name}#{n}" } |