Skip to content
Snippets Groups Projects
Select Git revision
  • develop
  • renovate/quasar-1.x
  • renovate/quasar-app-1.x
  • 27-add-possibility-to-view-removed-metadata
  • master
  • v1.0.0
  • v0.2.0
  • v0.1.0
8 results

Dockerfile

Blame
  • Forked from jfriedli / mat2-quasar-frontend
    Source project has a limited visibility.
    inventary_test.go 825 B
    package api
    
    import (
    	"net/http"
    	"testing"
    
    	"0xacab.org/meskio/cicer/api/db"
    )
    
    var testSupplier = db.Supplier{
    	Name: "Aceites Geronimo",
    }
    
    func TestSupplierAddList(t *testing.T) {
    	tapi := newTestAPI(t)
    	defer tapi.close()
    	tapi.addTestSuppliers()
    
    	var suppliers []db.Supplier
    	resp := tapi.do("GET", "/supplier", nil, &suppliers)
    	if resp.StatusCode != http.StatusOK {
    		t.Fatal("Can't get suppliers:", resp.Status)
    	}
    
    	if len(suppliers) != 1 {
    		t.Fatal("Wrong number of suppliers", len(suppliers), suppliers)
    	}
    	if suppliers[0].Name != testSupplier.Name {
    		t.Error("Wrong name:", suppliers[0].Name)
    	}
    }
    
    func (tapi *testAPI) addTestSuppliers() {
    	resp := tapi.doAdmin("POST", "/supplier", testSupplier, nil)
    	if resp.StatusCode != http.StatusCreated {
    		tapi.t.Fatal("Can't create supplier:", resp.Status)
    	}
    }