summaryrefslogtreecommitdiffstats
path: root/store/sql_preference_store_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-06-27 08:02:08 -0700
committerGitHub <noreply@github.com>2017-06-27 08:02:08 -0700
commit9659a6da06852ede9bf6b87c0e39a543e88a5034 (patch)
tree56408b6104465af171a03f6a7eeb0b01099ab5e4 /store/sql_preference_store_test.go
parent28bf900205c71259369f9a05b349786a39084f5d (diff)
downloadchat-9659a6da06852ede9bf6b87c0e39a543e88a5034.tar.gz
chat-9659a6da06852ede9bf6b87c0e39a543e88a5034.tar.bz2
chat-9659a6da06852ede9bf6b87c0e39a543e88a5034.zip
Stage 1 of caching layer. Framework (#6693)
Diffstat (limited to 'store/sql_preference_store_test.go')
-rw-r--r--store/sql_preference_store_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/store/sql_preference_store_test.go b/store/sql_preference_store_test.go
index c0df7a85b..b94a39707 100644
--- a/store/sql_preference_store_test.go
+++ b/store/sql_preference_store_test.go
@@ -4,8 +4,9 @@
package store
import (
- "github.com/mattermost/platform/model"
"testing"
+
+ "github.com/mattermost/platform/model"
)
func TestPreferenceSave(t *testing.T) {
@@ -343,10 +344,10 @@ func TestDeleteUnusedFeatures(t *testing.T) {
Must(store.Preference().Save(&features))
- store.(*SqlStore).preference.(*SqlPreferenceStore).DeleteUnusedFeatures()
+ store.Preference().(*SqlPreferenceStore).DeleteUnusedFeatures()
//make sure features with value "false" have actually been deleted from the database
- if val, err := store.(*SqlStore).preference.(*SqlPreferenceStore).GetReplica().SelectInt(`SELECT COUNT(*)
+ if val, err := store.Preference().(*SqlPreferenceStore).GetReplica().SelectInt(`SELECT COUNT(*)
FROM Preferences
WHERE Category = :Category
AND Value = :Val
@@ -357,7 +358,7 @@ func TestDeleteUnusedFeatures(t *testing.T) {
}
//
// make sure features with value "true" remain saved
- if val, err := store.(*SqlStore).preference.(*SqlPreferenceStore).GetReplica().SelectInt(`SELECT COUNT(*)
+ if val, err := store.Preference().(*SqlPreferenceStore).GetReplica().SelectInt(`SELECT COUNT(*)
FROM Preferences
WHERE Category = :Category
AND Value = :Val