Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F12687383
author_test.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
691 B
Subscribers
None
author_test.go
View Options
package
writeas
import
"testing"
func
TestClient_CreateContributor
(
t
*
testing
.
T
)
{
c
:=
NewClientWith
(
Config
{
URL
:
"http://localhost:7777/api"
})
_
,
err
:=
c
.
LogIn
(
"test"
,
"test"
)
if
err
!=
nil
{
t
.
Fatalf
(
"login: %s"
,
err
)
}
tests
:=
[]
struct
{
name
string
AName
string
ASlug
string
AOrg
string
}{
{
name
:
"good"
,
AName
:
"Bob Contrib"
,
ASlug
:
"bob"
,
AOrg
:
"write-as"
,
},
}
for
_
,
test
:=
range
tests
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
_
,
err
=
c
.
CreateContributor
(
&
AuthorParams
{
Name
:
test
.
AName
,
Slug
:
test
.
ASlug
,
OrgAlias
:
test
.
AOrg
,
})
if
err
!=
nil
{
t
.
Fatalf
(
"create %s: %s"
,
test
.
name
,
err
)
}
})
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 14, 3:45 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3534112
Attached To
rWGO writeas-go
Event Timeline
Log In to Comment