Skip to content
Snippets Groups Projects
Select Git revision
  • 1a97f81674fffdc2e477d699aaefcf8230dd9224
  • master default protected
  • feature/PRXS-3106-NoCache
  • feature/PRXS-3043-NewURLFormat
  • feature/2781-SpacesLoggingMiddleware
  • feature/PRXS-2974-FillImageDimensions
  • feature/PRXS-3143-3235-ReferenceOptions
  • feature/PRXS-3056-LocalesFromToMap
  • feature/PRXS-3421-ImplementNewRefAPI
  • feature/PRXS-3143-LimitReferenceFields
  • feature/PRXS-3234-FeaturePruneIdents
  • PRXS-3421-RecursiveReferences
  • feature/3109-SerializeFeature
  • release/0.33
  • feature/3109-RecoverySchema
  • feature/3109-feature
  • fix/PRXS-3369-ValidateFields
  • refactor/PRXS-3306-MovePkgGroup1
  • refactor/6-pkg-refactor-expr
  • fix/PRXS-3360-TemplateBuilderPatch
  • feature/3293-MongoV2
  • v0.33.1
  • v0.32.0
  • v0.31.1
  • v0.31.0
  • v0.30.0
  • v0.29.0
  • v0.28.0
  • v0.27.0-alpha.1+16
  • v0.27.0-alpha.1+15
  • v0.27.0-alpha.1+14
  • v0.27.0-alpha.1+13
  • v0.27.0-alpha.1+12
  • v0.27.0-alpha.1+11
  • v0.27.0-alpha.1+10
  • v0.27.0-alpha.1+9
  • v0.27.0-alpha.1+8
  • v0.27.0-alpha.1+7
  • v0.27.0-alpha.1+6
  • v0.27.0-alpha.1+5
  • v0.27.0-alpha.1+4
41 results

service.go

Blame
  • action_test.go 2.70 KiB
    package action
    
    import (
    	"fmt"
    	"net/url"
    	"testing"
    
    	"github.com/stretchr/testify/assert"
    )
    
    func TestActionURL_New(t *testing.T) {
    	tests := []struct {
    		name    string
    		action  string
    		want    *URL
    		url     string
    		wantErr assert.ErrorAssertionFunc
    	}{
    		{
    			name:    "Without action",
    			want:    &URL{},
    			wantErr: assert.NoError,
    		},
    		{
    			name:    "Without deprecated action call",
    			action:  "build-site",
    			want:    &URL{},
    			url:     "build-site",
    			wantErr: assert.NoError,
    		},
    		{
    			name:   "With grpc action",
    			action: "grpc:///perxisweb/build-site",
    			want: &URL{
    				id:        "build-site",
    				extension: "perxisweb",
    			},
    			url:     "grpc:///perxisweb/build-site",
    			wantErr: assert.NoError,
    		},
    		{
    			name:   "With ui action",
    			action: "ui:///space/env/coll",
    			want: &URL{
    				id:        "",
    				extension: "",
    			},
    			url:     "ui:///space/env/coll",
    			wantErr: assert.NoError,
    		},
    		{
    			name:    "With http action",
    			action:  "https://perx.ru",
    			want:    &URL{},
    			url:     "https://perx.ru",
    			wantErr: assert.NoError,
    		},
    		{
    			name:    "With error in parse",
    			action:  "grpc://user:abc{DEf1=ghi@example.com:5432/db?sslmode=require",
    			want:    nil,
    			wantErr: assert.Error,
    		},
    		{
    			name:    "With no action id",
    			action:  "grpc:///perxisweb",
    			want:    nil,
    			wantErr: assert.Error,
    		},
    	}