# Copyright (c) 2015 Perforce Software, Inc. All rights reserved. require 'rspec' require 'p4_project_services_client' require 'ffaker' require_relative 'test_connections' project_id_1 = "test_project_#{rand(10000)}" project_id_2 = "test_project_#{rand(10000)}" RSpec.describe P4ProjectServicesClient::Client, '#create_project' do it 'should create the project "test_project"' do client_as_jdoe do |client| client.create_project({ id: project_id_1, name: 'Test Project', owner: 'jdoe', branches: [ { id: 'master', name: 'master', view: [ { depot_path: '//depot/test_project/master/...', view_path: '...' } ] } ] }) end end it 'should create the project "second_project"' do client_as_jdoe do |client| client.create_project({ id: project_id_2, name: 'Second Project', owner: 'super', branches: [ { id: 'master', name: 'master', view: [ { depot_path: '//depot/second_project/master/...', view_path: '...' } ] } ] }) end end end RSpec.describe P4ProjectServicesClient::Client, '#projects' do it "should load the 'test_project' and 'second_project' from all projects" do client_as_jdoe do |client| projects = client.projects project_ids = projects.map(&:id) expect(project_ids).to include(project_id_1) expect(project_ids).to include(project_id_2) end end it "should load 'test_project' only when filtering by 'jdoe' owner" do client_as_jdoe do |client| projects = client.projects(owners: 'jdoe') project_ids = projects.map(&:id) expect(project_ids).to include(project_id_1) expect(project_ids).to_not include(project_id_2) end end it "should load 'test_project' only when filtering by 'Test Project' names" do client_as_jdoe do |client| projects = client.projects(names: 'Test Project') project_ids = projects.map(&:id) expect(project_ids).to include(project_id_1) expect(project_ids).to_not include(project_id_2) end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 13972 | tjuricek |
Removing old microservice implementations. The system is now mostly a monolith. Eventually there will be a websocket service. |
||
#3 | 13463 | tjuricek | Replace crappy indexing mechanism with Postgres queries. | ||
#2 | 13419 | tjuricek | The p4_project_services specs now run that provide basic create-read ability. | ||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |