2013-02-06 03:16:51 +08:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'discourse_task/plugin'
|
|
|
|
|
|
|
|
describe DiscourseTask::Plugin do
|
|
|
|
|
|
|
|
let(:registry) { stub_everything }
|
|
|
|
let(:plugin) { DiscourseTask::Plugin.new(registry) }
|
|
|
|
|
|
|
|
context '.setup' do
|
|
|
|
|
2013-02-26 00:42:20 +08:00
|
|
|
it 'registers its js' do
|
2013-02-06 03:16:51 +08:00
|
|
|
plugin.expects(:register_js).with('discourse_task')
|
|
|
|
plugin.setup
|
2013-02-26 00:42:20 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-02-26 00:42:20 +08:00
|
|
|
it 'registers its css' do
|
2013-02-06 03:16:51 +08:00
|
|
|
plugin.expects(:register_css).with('discourse_task')
|
|
|
|
plugin.setup
|
2013-02-26 00:42:20 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-02-26 00:42:20 +08:00
|
|
|
it 'registers a task archetype' do
|
2013-02-06 03:16:51 +08:00
|
|
|
plugin.expects(:register_archetype).with('task')
|
|
|
|
plugin.setup
|
2013-02-26 00:42:20 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|