test/basic_test.rb in losant_rest-1.19.4 vs test/basic_test.rb in losant_rest-1.19.6

- old
+ new

@@ -9,11 +9,11 @@ .with(body: '{"email":"myemail@myemail.com","password":"mypassword"}', headers: { "Accept" => "application/json" }). to_return(body: '{ "userId": "theUserId", "token": "an auth token string"}', status: 200, headers: { "Content-Type" => "application/json" }); - client = LosantRest::Client.new + client = PlatformRest::Client.new response = client.auth.authenticate_user(credentials: { email: "myemail@myemail.com", password: "mypassword" }) @@ -25,11 +25,11 @@ "https://api.losant.com/applications?_actions=false&_embedded=true&_links=true") .with(headers: { "Accept" => "application/json", "Authorization" => "Bearer my token" }). to_return(body: '{ "count": 0, "items": [] }', status: 200, headers: { "Content-Type" => "application/json" }); - client = LosantRest::Client.new(auth_token: "my token") + client = PlatformRest::Client.new(auth_token: "my token") response = client.applications.get assert_equal response, { "count" => 0, "items" => [] } end @@ -38,11 +38,11 @@ "https://api.losant.com/applications/appId/devices?_actions=false&_links=true&_embedded=true&tagFilter[0][key]=key2&tagFilter[1][key]=key1&tagFilter[1][value]=value1&tagFilter[2][value]=value2") .with(headers: { "Accept" => "application/json", "Authorization" => "Bearer my token" }). to_return(body: '{ "count": 0, "items": [] }', status: 200, headers: { "Content-Type" => "application/json" }); - client = LosantRest::Client.new(auth_token: "my token") + client = PlatformRest::Client.new(auth_token: "my token") response = client.devices.get(applicationId: "appId", tagFilter: [ { key: "key2" }, { key: "key1", value: "value1" }, { value: "value2" }, @@ -55,11 +55,11 @@ "https://api.losant.com/applications/appId/events?_actions=false&_links=true&_embedded=true&query=%7B%22$and%22:%5B%7B%22level%22:%22info%22%7D,%7B%22state%22:%22new%22%7D%5D%7D") .with(headers: { "Accept" => "application/json", "Authorization" => "Bearer my token" }). to_return(body: '{ "count": 0, "items": [] }', status: 200, headers: { "Content-Type" => "application/json" }); - client = LosantRest::Client.new(auth_token: "my token") + client = PlatformRest::Client.new(auth_token: "my token") response = client.events.get(applicationId: "appId", query: { :"$and" => [ { level: "info" }, { state: "new" }] }) assert_equal response, { "count" => 0, "items" => [] } @@ -70,12 +70,12 @@ "https://api.losant.com/applications?_actions=false&_embedded=true&_links=true") .with(headers: { "Accept" => "application/json", "Authorization" => "Bearer my token" }). to_return(body: '{ "count": 0, "items": [] }', status: 200, headers: { "Content-Type" => "application/json" }); - LosantRest.client.auth_token = "my token" + PlatformRest.client.auth_token = "my token" - response = LosantRest.applications.get + response = PlatformRest.applications.get assert_equal response, { "count" => 0, "items" => [] } end end end