summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-25 18:46:19 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-25 18:46:19 +0200
commitaadfb3665f39e5886254bac856ebd1cc47f8c652 (patch)
treea0a199706497cd058e7f0bd4666622f72e213157
parent592e396869ba5dc116cec333733cea8dfbf4a9b5 (diff)
downloadgitlab-ce-aadfb3665f39e5886254bac856ebd1cc47f8c652.tar.gz
Fix tests and add message if no oauth apps
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/controllers/oauth/applications_controller.rb2
-rw-r--r--app/views/profiles/applications.html.haml34
-rw-r--r--features/profile/profile.feature6
-rw-r--r--features/steps/shared/paths.rb4
4 files changed, 27 insertions, 19 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb
index 93201eff303..3407490e498 100644
--- a/app/controllers/oauth/applications_controller.rb
+++ b/app/controllers/oauth/applications_controller.rb
@@ -26,7 +26,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :destroy])
end
- redirect_to profile_account_url
+ redirect_to applications_profile_url
end
private
diff --git a/app/views/profiles/applications.html.haml b/app/views/profiles/applications.html.haml
index cdb188dc1af..cb24e4a3dde 100644
--- a/app/views/profiles/applications.html.haml
+++ b/app/views/profiles/applications.html.haml
@@ -26,18 +26,22 @@
%fieldset.oauth-authorized-applications.prepend-top-20
%legend Authorized applications
- %table.table.table-striped
- %thead
- %tr
- %th Name
- %th Authorized At
- %th Scope
- %th
- %tbody
- - @authorized_tokens.each do |token|
- - application = token.application
- %tr{:id => "application_#{application.id}"}
- %td= application.name
- %td= token.created_at
- %td= token.scopes
- %td= render 'doorkeeper/authorized_applications/delete_form', application: application
+
+ - if @authorized_tokens.any?
+ %table.table.table-striped
+ %thead
+ %tr
+ %th Name
+ %th Authorized At
+ %th Scope
+ %th
+ %tbody
+ - @authorized_tokens.each do |token|
+ - application = token.application
+ %tr{:id => "application_#{application.id}"}
+ %td= application.name
+ %td= token.created_at
+ %td= token.scopes
+ %td= render 'doorkeeper/authorized_applications/delete_form', application: application
+ - else
+ %p.light You dont have any authorized applications
diff --git a/features/profile/profile.feature b/features/profile/profile.feature
index 88a7a3e726b..fd132e1cd80 100644
--- a/features/profile/profile.feature
+++ b/features/profile/profile.feature
@@ -72,7 +72,7 @@ Feature: Profile
Then I should see my user page
Scenario: I can manage application
- Given I visit profile account page
+ Given I visit profile applications page
Then I click on new application button
And I should see application form
Then I fill application form out and submit
@@ -81,7 +81,7 @@ Feature: Profile
And I see edit application form
Then I change name of application and submit
And I see that application was changed
- Then I visit profile account page
+ Then I visit profile applications page
And I click to remove application
Then I see that application is removed
@@ -115,4 +115,4 @@ Feature: Profile
Scenario: I see the password strength indicator with success
Given I visit profile password page
When I try to set a strong password
- Then I should see the input field green \ No newline at end of file
+ Then I should see the input field green
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 5f292255ce1..ca038732231 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -94,6 +94,10 @@ module SharedPaths
visit profile_path
end
+ step 'I visit profile applications page' do
+ visit applications_profile_path
+ end
+
step 'I visit profile password page' do
visit edit_profile_password_path
end