summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-01-19 11:18:00 -0800
committerValery Sizov <valery@gitlab.com>2015-01-19 11:18:00 -0800
commit1809b3ee36b38cd47504114dfb1fed53206ebd15 (patch)
tree09e92374768004756b731e354cf46042bd52e9c5
parent2fba31890e922fa8bae61e7aa3f21c5b4314e735 (diff)
downloadgitlab-ce-1809b3ee36b38cd47504114dfb1fed53206ebd15.tar.gz
Spinach for admin applications
-rw-r--r--app/views/admin/applications/index.html.haml2
-rw-r--r--features/admin/applications.feature18
-rw-r--r--features/steps/admin/applications.rb55
-rw-r--r--features/steps/shared/paths.rb4
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
# ----------------------------------------