# describe "#<%= action_name %>" do # # let!(:params) { { "something" => something } } # let!(:use_case_class) { <%= use_case %> } # # before { allow(use_case_class).to receive(:new) { use_case } } # after { <%= action_type %> :<%= action_name %>, params } # # it "initializes a proper use case with allowed parameters" do # expect(use_case_class).to receive(:new) do |options| # expect(options).to eq params. # slice %w(something) # end # end # # it "listens to use case notifications" do # expect(use_case).to receive(:subscribe) do |listener| # expect(listener).to eq controller # end # end # # it "runs the case after all subscribtion" do # expect(use_case).to receive(:subscribe).exactly(1).times.order # expect(use_case).to receive(:run).order # end # end