Merge discourse-narrative-bot into core plugins.

This commit is contained in:
Guo Xiang Tan
2017-05-24 13:50:20 +08:00
parent 796a2967af
commit 7f0561b621
52 changed files with 7298 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
require 'rails_helper'
describe DiscourseNarrativeBot::Store do
describe '.set' do
it 'should set the right value in the plugin store' do
key = 'somekey'
described_class.set(key, 'yay')
plugin_store_row = PluginStoreRow.last
expect(plugin_store_row.value).to eq('yay')
expect(plugin_store_row.plugin_name).to eq(DiscourseNarrativeBot::PLUGIN_NAME)
expect(plugin_store_row.key).to eq(key)
end
end
describe '.get' do
it 'should get the right value from the plugin store' do
PluginStoreRow.create!(
plugin_name: DiscourseNarrativeBot::PLUGIN_NAME,
key: 'somekey',
value: 'yay',
type_name: 'string'
)
expect(described_class.get('somekey')).to eq('yay')
end
end
end