spec/wei_backend_spec.rb in wei-backend-0.0.4 vs spec/wei_backend_spec.rb in wei-backend-0.0.5

- old
+ new

@@ -27,12 +27,22 @@ last_response.body.should include '<Title><![CDATA[title]]></Title>' end it 'should return news message when receive a text request message and user defined a multi-news' do WeiBackend::MessageDispatcher.on_text do - [{:title => 'title', :description => 'desc', :picture_url => 'pic url', :url => 'url'}, - {:title => 'title1', :description => 'desc1', :picture_url => 'pic url1', :url => 'url1'}] + [{ + :title => 'title', + :description => 'desc', + :picture_url => 'pic url', + :url => 'url' + }, + { + :title => 'title1', + :description => 'desc1', + :picture_url => 'pic url1', + :url => 'url1' + }] end post '/', TEXT_MESSAGE_REQUEST, 'CONTENT_TYPE' => 'text/xml' last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>' last_response.body.should include '<Title><![CDATA[title]]></Title>' @@ -52,10 +62,10 @@ it 'should echo location message when receive a location event message' do WeiBackend::MessageDispatcher.on_subscribe do 'Thank you for subscribe!' end - post '/', LOCATION_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml' + post '/', SUBSCRIBE_EVENT_REQUEST, 'CONTENT_TYPE' => 'text/xml' last_response.body.should include '<ToUserName><![CDATA[fromUser]]></ToUserName>' last_response.body.should include '<Content><![CDATA[Thank you for subscribe!]]></Content>' end end