spec/controllers/dashing/widgets_controller_spec.rb in dashing-rails-2.2.0 vs spec/controllers/dashing/widgets_controller_spec.rb in dashing-rails-2.3.0
- old
+ new
@@ -1,9 +1,15 @@
require 'spec_helper'
describe Dashing::WidgetsController do
+ let(:redis) { double }
+
+ before do
+ stub_redis(redis)
+ end
+
describe 'GET "show"' do
def action(params = {})
get :show, params.merge(use_route: :dashing)
end
@@ -40,9 +46,13 @@
def action(params = {})
put :update, params.merge(use_route: :dashing)
end
context 'when valid' do
+
+ before do
+ expect(redis).to receive(:publish)
+ end
it 'responds success' do
action(name: 'foo')
expect(response).to be_success
end