require_relative 'config' require 'ffaker' require 'p4_project_services' include P4ProjectServices # These are simple tests of DB interaction. # # Validation that we can create from the full JSON structure involves P4 # interaction, which needs to be tested in an environment including our # p4_web_api. def create_project project = Models::Project.new project.id = Faker::Guid.guid project.name = Faker::Name.name project.owner = Faker.letterify('xxxxxxxxxx') project.group = Faker.letterify('xxxxxxxxxx') project.description = Faker::DizzleIpsum.words(30) project.save project end def create_branch_with_stream branch = Models::Branch.new branch.id = Faker.hexify('xxxxxxxxxx') branch.name = Faker::Name.name branch.stream = "//#{Faker.hexify('xxxxxxx')}/#{Faker.hexify('xxxx')}" branch.save branch end describe 'Project' do it 'can create a project instance with a stream branch' do project = create_project project.add_branch(create_branch_with_stream) project.save loaded = Models::Project.dataset.where(id: project.id).first expect(loaded.name).to eq(project.name) expect(loaded.owner).to eq(project.owner) expect(loaded.group).to eq(project.group) expect(loaded.description).to eq(project.description) expect(loaded.branches).to eq(project.branches) end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 13972 | tjuricek |
Removing old microservice implementations. The system is now mostly a monolith. Eventually there will be a websocket service. |
||
#1 | 13462 | tjuricek |
Created a preliminary caching schema and basic database models for the p4 project services. This may break some tests momentarily until I implement caching. |