-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing the issue of not being able to add a new project for personal …
…accounts. (#48) * Add deps - github.com/stretchr/testify/assert - github.com/stretchr/testify/require * Omit orgaization_slug from create app request if empty
- Loading branch information
Showing
51 changed files
with
22,616 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package phases | ||
|
||
import ( | ||
"encoding/json" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestRegistrationParams(t *testing.T) { | ||
type testCase struct { | ||
organizationSlug string | ||
isExpectedInJSON bool | ||
} | ||
testCases := []testCase{ | ||
{ | ||
"", | ||
false, | ||
}, | ||
{ | ||
"notempty", | ||
true, | ||
}, | ||
} | ||
|
||
for _, test := range testCases { | ||
// Given | ||
progress := Progress{} | ||
progress.OrganizationSlug = test.organizationSlug | ||
|
||
// When | ||
params, err := toRegistrationParams(progress) | ||
bytes, err := json.Marshal(params) | ||
|
||
// Then | ||
require.NoError(t, err) | ||
assert.Equal(t, test.isExpectedInJSON, strings.Contains(string(bytes), "organization_slug")) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.