spec/api/messages_api_spec.rb in artikcloud-2.0.0 vs spec/api/messages_api_spec.rb in artikcloud-2.0.5
- old
+ new
@@ -20,11 +20,11 @@
# Please update as you see appropriate
describe 'MessagesApi' do
before do
# run before each test
configuration = ArtikCloud::Configuration.new
- configuration.access_token = '1eef3e3251e147d1ac707a57f6779c49'
+ configuration.access_token = 'dc43d12e2b59495daf94631e6ddfe3e8'
api_client = ArtikCloud::ApiClient.new(configuration)
@instance = ArtikCloud::MessagesApi.new(api_client)
end
after do
@@ -43,19 +43,19 @@
# @param data Message or Action object that is passed in the body
# @param [Hash] opts the optional parameters
# @return [MessageIDEnvelope]
describe 'send_message_action test' do
it "should work" do
- message = ArtikCloud::MessageAction.new
+ message = ArtikCloud::Message.new
message.type = "message"
- message.sdid = "993925c3cd994bf7a51c620884be65e9"
+ message.sdid = "19da42ee01414722a6ad1224097c38d4"
message.ts = Time.now.to_f*1000
message.data = {
- :'volume' => 5
+ :'steps' => 500
}
- result = @instance.send_message_action(message)
+ result = @instance.send_message(message)
result.should be_a(ArtikCloud::MessageIDEnvelope)
message_id = result.data.mid
sleep(2)
@@ -68,12 +68,12 @@
normalized_messages.size.should == 1
normalized = normalized_messages.data[0]
normalized.mid.should == message_id
- volume = normalized.data["volume"]
+ volume = normalized.data["steps"]
volume.should_not be_nil
- volume.should == 5
+ volume.should == 500
end
end
end