Rails Rspec测试控制器是否触发了Websockets事件

时间:2015-05-06 04:50:17

标签: ruby-on-rails testing rspec websocket

在我的控制器中,我有以下代码在update方法中触发websockets事件:

WebsocketRails[recipient.id].trigger "new_activity", "Shared" if recipient.online?

如何测试我的控制器是否正在触发此事件?

1 个答案:

答案 0 :(得分:1)

Stream scriptelfen;
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if((scriptelfen = openFileDialog1.OpenFile())!= null)
                {
                string strfilename = openFileDialog1.FileName;
                string filetext = File.ReadAllText(strfilename);
                script_box.Text = filetext;