Sha256: caa3f33986993da91ea6c020a61e8256790eae9a2b13f1b308093251d4600c26
Contents?: true
Size: 1.18 KB
Versions: 23
Compression:
Stored size: 1.18 KB
Contents
require 'test_helper' class User::RealSnapChatTest < IT include Loco::Emitter include UserHelpers include CapybaraOffline def setup super @room = Room.create! name: "Business" sign_in_user 'zbigniew.humeniuk@example.com', 'secret' click_on "RealSnapChat rooms" click_on "Join" sleep 0.1 end def teardown super HubFinder.new(@room).find.destroy end test "should show room's members" do join_room users(:user_jane), @room assert page.has_content? 'zbig' assert page.has_content? 'jane' end test "should send messages" do if Rails.version.to_i == 4 skip "Rails4 does not support web sockets." end join_room users(:user_jane), @room fill_in 'message', with: 'Hello Jane!' find('#message').native.send_keys :return assert page.has_content? 'zbig: Hello Jane!' emit_to HubFinder.new(@room).find, signal: 'message', message: 'Hi zbig!', author: 'jane' assert page.has_content? 'jane: Hi zbig!' end test "should show info about joining room after returning from disconnection" do go_disconnected join_room users(:user_jane), @room go_connected assert page.has_content? 'jane' end end
Version data entries
23 entries across 23 versions & 1 rubygems