Commit 5dd2f36a authored by Jeroen van Baarsen's avatar Jeroen van Baarsen

Added API testing group

parent 25eadf0c
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
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
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}
......
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}
......
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) }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
let(:user1) { create(:user) }
......
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) }
......
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) }
......
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) }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
before(:each) { enable_observers }
after(:each) {disable_observers}
......
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) }
......
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) }
......
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 }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
before(:each) { enable_observers }
after(:each) { disable_observers }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
before(:each) { enable_observers }
after(:each) { disable_observers }
......
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}
......
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) }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
describe API::API do
describe API::API, api: true do
include ApiHelpers
let(:user) { create(:user) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment