diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-01-19 20:58:12 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-01-19 20:58:12 +0000 |
commit | 0166d8d8e53ff67fb3bc759fa6a8e0aa0bb3edda (patch) | |
tree | c2a12f0d0f5e89db39c5b771b728fa0dba0c33b8 | |
parent | 465f41673a418096b761d12438301c7b217f9a81 (diff) | |
parent | 1809b3ee36b38cd47504114dfb1fed53206ebd15 (diff) | |
download | gitlab-ce-0166d8d8e53ff67fb3bc759fa6a8e0aa0bb3edda.tar.gz |
Merge branch 'spinach_admin_application' into 'master'
Spinach admin application
See merge request !1410
-rw-r--r-- | app/views/admin/applications/index.html.haml | 2 | ||||
-rw-r--r-- | features/admin/applications.feature | 18 | ||||
-rw-r--r-- | features/steps/admin/applications.rb | 55 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 4 |
4 files changed, 78 insertions, 1 deletions
diff --git a/app/views/admin/applications/index.html.haml b/app/views/admin/applications/index.html.haml index 97991ca13e6..f2fed51eaf8 100644 --- a/app/views/admin/applications/index.html.haml +++ b/app/views/admin/applications/index.html.haml @@ -12,7 +12,7 @@ %th Clients %th %th - %tbody + %tbody.oauth-applications - @applications.each do |application| %tr{:id => "application_#{application.id}"} %td= link_to application.name, admin_application_path(application) diff --git a/features/admin/applications.feature b/features/admin/applications.feature new file mode 100644 index 00000000000..2a00e1666c0 --- /dev/null +++ b/features/admin/applications.feature @@ -0,0 +1,18 @@ +@admin +Feature: Admin Applications + Background: + Given I sign in as an admin + And I visit applications page + + Scenario: I can manage application + Then I click on new application button + And I should see application form + Then I fill application form out and submit + And I see application + Then I click edit + And I see edit application form + Then I change name of application and submit + And I see that application was changed + Then I visit applications page + And I click to remove application + Then I see that application is removed
\ No newline at end of file diff --git a/features/steps/admin/applications.rb b/features/steps/admin/applications.rb new file mode 100644 index 00000000000..d59088fa3c3 --- /dev/null +++ b/features/steps/admin/applications.rb @@ -0,0 +1,55 @@ +class Spinach::Features::AdminApplications < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + + step 'I click on new application button' do + click_on 'New Application' + end + + step 'I should see application form' do + page.should have_content "New application" + end + + step 'I fill application form out and submit' do + fill_in :doorkeeper_application_name, with: 'test' + fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' + click_on "Submit" + end + + step 'I see application' do + page.should have_content "Application: test" + page.should have_content "Application Id" + page.should have_content "Secret" + end + + step 'I click edit' do + click_on "Edit" + end + + step 'I see edit application form' do + page.should have_content "Edit application" + end + + step 'I change name of application and submit' do + page.should have_content "Edit application" + fill_in :doorkeeper_application_name, with: 'test_changed' + click_on "Submit" + end + + step 'I see that application was changed' do + page.should have_content "test_changed" + page.should have_content "Application Id" + page.should have_content "Secret" + end + + step 'I click to remove application' do + within '.oauth-applications' do + click_on "Destroy" + end + end + + step "I see that application is removed" do + page.find(".oauth-applications").should_not have_content "test_changed" + end +end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 689b297dffc..33ef6ccacf1 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -171,6 +171,10 @@ module SharedPaths visit admin_application_settings_path end + step 'I visit applications page' do + visit admin_applications_path + end + # ---------------------------------------- # Generic Project # ---------------------------------------- |