spec/support/test_app.rb in ably-0.1.2 vs spec/support/test_app.rb in ably-0.1.3

- old
+ new

@@ -5,24 +5,23 @@ 'keys' => [ {} ], 'namespaces' => [ { 'id' => 'persisted', 'persisted' => true } + ], + 'channels' => [ + { + 'name' => 'persisted:presence_fixtures', + 'presence' => [ + { 'clientId' => 'client_bool', 'clientData' => true }, + { 'clientId' => 'client_int', 'clientData' => 24 }, + { 'clientId' => 'client_string', 'clientData' => 'This is a string clientData payload' }, + { 'clientId' => 'client_json', 'clientData' => { "test" => 'This is a JSONObject clientData payload'} } + ] + } ] - # ], - # 'channels' => [ - # { - # 'name' => 'persisted:presence_fixtures', - # 'presence' => [ - # { 'clientId' => 'client_bool', 'clientData' => true }, - # { 'clientId' => 'client_int', 'clientData' => 24 }, - # { 'clientId' => 'client_string', 'clientData' => 'This is a string clientData payload' }, - # { 'clientId' => 'client_json', 'clientData' => { "test" => 'This is a JSONObject clientData payload'} } - # ] - # } - # ] - }.to_json + } include Singleton def initialize url = "#{sandbox_client.endpoint}/apps" @@ -30,10 +29,10 @@ headers = { "Accept" => "application/json", "Content-Type" => "application/json" } - response = Faraday.post(url, APP_SPEC, headers) + response = Faraday.post(url, APP_SPEC.to_json, headers) @attributes = JSON.parse(response.body) end def app_id