Another HTTP API fix

This commit is contained in:
Torkel Ödegaard
2015-05-04 08:19:29 +02:00
parent 73ee8a5985
commit 38d851eb98
2 changed files with 43 additions and 13 deletions

View File

@@ -66,6 +66,24 @@ func TestDashboardDataAccess(t *testing.T) {
So(err, ShouldNotBeNil)
})
Convey("Should not be able to overwrite dashboard in another org", func() {
query := m.GetDashboardQuery{Slug: "test-dash-23", OrgId: 1}
GetDashboard(&query)
cmd := m.SaveDashboardCommand{
OrgId: 2,
Overwrite: true,
Dashboard: map[string]interface{}{
"id": float64(query.Result.Id),
"title": "Expect error",
"tags": []interface{}{},
},
}
err := SaveDashboard(&cmd)
So(err, ShouldNotBeNil)
})
Convey("Should be able to search for dashboard", func() {
query := m.SearchDashboardsQuery{
Title: "test",