diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-04-11 21:45:56 +0200 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-04-11 21:45:56 +0200 |
commit | 5dd2f36ae153ac5a933a4e6ae0ae773508aa1f74 (patch) | |
tree | 2eaa3b90c13fde04fad3a09ea5752ffaeadc5e75 | |
parent | 25eadf0c5bd05deb98f7ea0420fc5c63682cb989 (diff) | |
download | gitlab-ce-5dd2f36ae153ac5a933a4e6ae0ae773508aa1f74.tar.gz |
Added API testing group
-rw-r--r-- | lib/tasks/spec.rake | 36 | ||||
-rw-r--r-- | spec/requests/api/api_helpers_spec.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/branches_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/commits_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/files_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/groups_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/internal_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/milestones_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/namespaces_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/notes_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/project_hooks_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/project_members_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/repositories_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/services_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/session_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/system_hooks_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/api/users_spec.rb | 2 |
20 files changed, 39 insertions, 37 deletions
diff --git a/lib/tasks/spec.rake b/lib/tasks/spec.rake index 1f6ceca80bd..b760a607f7e 100644 --- a/lib/tasks/spec.rake +++ b/lib/tasks/spec.rake @@ -1,18 +1,11 @@ -namespace :testing do - desc 'GITLAB | Run model specs' - task :models do - cmds = [ - %W(rake gitlab:setup), - %W(rspec spec --tag @models) - ] - run_commands(cmds) - end +Rake::Task["spec"].clear if Rake::Task.task_defined?('spec') +namespace :spec do desc 'GITLAB | Run feature specs' - task :features do + task :api do cmds = [ %W(rake gitlab:setup), - %W(rspec spec --tag @features) + %W(rspec spec --tag @api) ] run_commands(cmds) end @@ -21,15 +14,24 @@ namespace :testing do task :other do cmds = [ %W(rake gitlab:setup), - %W(rspec spec --tag ~@models --tag ~@features) + %W(rspec spec --tag ~@api) ] run_commands(cmds) end +end + +desc "GITLAB | Run specs" +task :spec do + cmds = [ + %W(rake gitlab:setup), + %W(rspec spec), + ] + run_commands(cmds) +end - def run_commands(cmds) - cmds.each do |cmd| - system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) - raise "#{cmd} failed!" unless $?.exitstatus.zero? - end +def run_commands(cmds) + cmds.each do |cmd| + system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) + raise "#{cmd} failed!" unless $?.exitstatus.zero? end end diff --git a/spec/requests/api/api_helpers_spec.rb b/spec/requests/api/api_helpers_spec.rb index 2fc78a7e390..6f961d321bd 100644 --- a/spec/requests/api/api_helpers_spec.rb +++ b/spec/requests/api/api_helpers_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API do +describe API, api: true do include API::APIHelpers include ApiHelpers let(:user) { create(:user) } @@ -158,4 +158,4 @@ describe API do sudo_identifier.should == ' 123' end end -end
\ No newline at end of file +end diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb index f792c618e67..abf6a8646ec 100644 --- a/spec/requests/api/branches_spec.rb +++ b/spec/requests/api/branches_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'mime/types' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { enable_observers } after(:each) {disable_observers} diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index ea317e1137a..165276d1435 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'mime/types' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { enable_observers } after(:each) {disable_observers} diff --git a/spec/requests/api/files_spec.rb b/spec/requests/api/files_spec.rb index fa25a4bec6a..edfe935d985 100644 --- a/spec/requests/api/files_spec.rb +++ b/spec/requests/api/files_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb index 1a5f11038b7..6fcab85335a 100644 --- a/spec/requests/api/groups_spec.rb +++ b/spec/requests/api/groups_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers let(:user1) { create(:user) } diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index 5f6dff92c0a..8797c3fbbbf 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 0b4f22bfb3d..e62bc844352 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 9530f7ceb04..3918498e22f 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/milestones_spec.rb b/spec/requests/api/milestones_spec.rb index febfc63921e..0d2740c5acf 100644 --- a/spec/requests/api/milestones_spec.rb +++ b/spec/requests/api/milestones_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { enable_observers } after(:each) {disable_observers} diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index 2b1a4bf6ec8..2de7d1e23c3 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb index 6ed96eb97f3..81576f7c235 100644 --- a/spec/requests/api/notes_spec.rb +++ b/spec/requests/api/notes_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/project_hooks_spec.rb b/spec/requests/api/project_hooks_spec.rb index c8ace0b9462..6e281f5a43e 100644 --- a/spec/requests/api/project_hooks_spec.rb +++ b/spec/requests/api/project_hooks_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API, 'ProjectHooks' do +describe API::API, 'ProjectHooks', api: true do include ApiHelpers before(:each) { enable_observers } after(:each) { disable_observers } diff --git a/spec/requests/api/project_members_spec.rb b/spec/requests/api/project_members_spec.rb index f3c0529da92..ec2d6e85096 100644 --- a/spec/requests/api/project_members_spec.rb +++ b/spec/requests/api/project_members_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { enable_observers } after(:each) { disable_observers } diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 7fe65639657..4b8f41a4683 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { enable_observers } after(:each) { disable_observers } diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb index 44c561eab58..5a5222ed3c5 100644 --- a/spec/requests/api/repositories_spec.rb +++ b/spec/requests/api/repositories_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'mime/types' -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { enable_observers } after(:each) {disable_observers} diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb index aecd18bc14a..684f8615999 100644 --- a/spec/requests/api/services_spec.rb +++ b/spec/requests/api/services_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe API::API do +describe API::API, api: true do include ApiHelpers before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } diff --git a/spec/requests/api/session_spec.rb b/spec/requests/api/session_spec.rb index 668007dc29f..013f425d6ce 100644 --- a/spec/requests/api/session_spec.rb +++ b/spec/requests/api/session_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers let(:user) { create(:user) } diff --git a/spec/requests/api/system_hooks_spec.rb b/spec/requests/api/system_hooks_spec.rb index b1df3cb7886..5784ae8c23a 100644 --- a/spec/requests/api/system_hooks_spec.rb +++ b/spec/requests/api/system_hooks_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers let(:user) { create(:user) } diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index c4be5102002..86610c47513 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe API::API do +describe API::API, api: true do include ApiHelpers let(:user) { create(:user) } |