Method: UserTune::HelperTest#test_send_now_playing
- Defined in:
- lib/vendor/xmpp4r/test/tune/tc_helper_send.rb
#test_send_now_playing ⇒ Object
Test sending ‘now playing’ notifications
See www.xmpp.org/extensions/xep-0118.html#protocol-transport, example 1
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vendor/xmpp4r/test/tune/tc_helper_send.rb', line 23 def artist = 'Mike Flowers Pops' title = 'Light My Fire' tune_to_send = UserTune::Tune.new(artist, title) h = UserTune::Helper.new(@client, nil) assert_kind_of(UserTune::Helper, h) state { || assert_kind_of(Jabber::Iq, ) assert_equal :set, .type assert_kind_of(Jabber::PubSub::IqPubSub,.first_element('pubsub')) assert_equal(Jabber::UserTune::NS_USERTUNE,.first_element('pubsub').first_element('publish').node) tune=.first_element('pubsub').first_element('publish').first_element('item').first_element('tune') assert_kind_of Jabber::UserTune::Tune,tune assert_equal true, tune. assert_equal artist,tune.artist assert_equal title,tune.title assert_equal nil,tune.length assert_equal nil,tune.track assert_equal nil,tune.source assert_equal nil,tune.uri send("<iq type='result' id='#{.id}'/>") } h.(tune_to_send) wait_state end |