spec/unit/connection_manager_spec.rb in websocket-rails-0.1.4 vs spec/unit/connection_manager_spec.rb in websocket-rails-0.1.5
- old
+ new
@@ -15,11 +15,11 @@
let(:connections) { subject.connections }
let(:dispatcher) { subject.dispatcher }
before(:each) do
ConnectionAdapters::Base.any_instance.stub(:send)
- @mock_socket = ConnectionAdapters::Base.new(env,dispatcher)
+ @mock_socket = ConnectionAdapters::Base.new(mock_request,dispatcher)
ConnectionAdapters.stub(:establish_connection).and_return(@mock_socket)
end
context "new connections" do
it "should add one to the total connection count" do
@@ -36,11 +36,11 @@
end
end
context "new POST event" do
before(:each) do
- @mock_http = ConnectionAdapters::Http.new(env,dispatcher)
+ @mock_http = ConnectionAdapters::Http.new(mock_request,dispatcher)
app.connections << @mock_http
end
it "should receive the new event for the correct connection" do
@mock_http.should_receive(:on_message).with(encoded_message)
@@ -48,10 +48,10 @@
end
end
context "open connections" do
before(:each) do
- ConnectionAdapters.stub(:establish_connection).and_return(@mock_socket,ConnectionAdapters::Base.new(env,dispatcher))
+ ConnectionAdapters.stub(:establish_connection).and_return(@mock_socket,ConnectionAdapters::Base.new(mock_request,dispatcher))
4.times { open_connection }
end
context "when receiving a new event" do
before(:each) { open_connection }