mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-22 09:20:33 -05:00
* bundled jira plugin * fix generated file formatting, add prepackaged key * whoops, uploaded wrong file * whitelist generated files for license check * make it work for people without go/bin in their path
31 lines
693 B
Go
31 lines
693 B
Go
package model
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPluginsResponseJson(t *testing.T) {
|
|
manifest := &Manifest{
|
|
Id: "theid",
|
|
Backend: &ManifestBackend{
|
|
Executable: "theexecutable",
|
|
},
|
|
Webapp: &ManifestWebapp{
|
|
BundlePath: "thebundlepath",
|
|
},
|
|
}
|
|
|
|
response := &PluginsResponse{
|
|
Active: []*PluginInfo{{Manifest: *manifest}},
|
|
Inactive: []*PluginInfo{},
|
|
}
|
|
|
|
json := response.ToJson()
|
|
newResponse := PluginsResponseFromJson(strings.NewReader(json))
|
|
assert.Equal(t, newResponse, response)
|
|
assert.Equal(t, newResponse.ToJson(), json)
|
|
assert.Equal(t, PluginsResponseFromJson(strings.NewReader("junk")), (*PluginsResponse)(nil))
|
|
}
|