spec/urbanairship_spec.rb in urbanairship-2.3.1 vs spec/urbanairship_spec.rb in urbanairship-2.3.2

- old
+ new

@@ -396,21 +396,34 @@ it "uses the iOS interface by default" do subject.register_device("new_device_token") FakeWeb.last_request.path.should == "/api/device_tokens/new_device_token" end - it "uses the android interface if 'provider' configuration option is set to :android" do + it "uses the android interface if 'provider' configuration option is set to :android Symbol" do subject.provider = :android subject.register_device("new_device_token") FakeWeb.last_request.path.should == "/api/apids/new_device_token" subject.provider = nil end - it "uses the android interface if 'provider' option is passed as :android" do + it "uses the android interface if 'provider' configuration option is set to 'android' String" do + subject.provider = 'android' + subject.register_device("new_device_token") + FakeWeb.last_request.path.should == "/api/apids/new_device_token" + subject.provider = nil + end + + it "uses the android interface if :provider Symbol key is passed an :android Symbol value" do subject.register_device("new_device_token", :provider => :android) FakeWeb.last_request.path.should == "/api/apids/new_device_token" end + + it "uses the android interface if 'provider' Symbol key is passed an 'android' String value" do + subject.register_device("new_device_token", :provider => "android") + FakeWeb.last_request.path.should == "/api/apids/new_device_token" + end + end describe "::unregister_device" do before(:each) do subject.application_key = "my_app_key" @@ -444,22 +457,34 @@ it "returns false when the authorization is invalid" do subject.application_key = "bad_key" subject.unregister_device("key_to_delete").success?.should == false end - it "uses the android interface if 'provider' configuration option is set to :android" do + it "uses the android interface if 'provider' configuration option is set to :android Symbol" do subject.provider = :android subject.unregister_device("new_device_token") FakeWeb.last_request.path.should == "/api/apids/new_device_token" subject.provider = nil end - it "uses the android interface if 'provider' option is passed as :android" do + it "uses the android interface if 'provider' configuration option is set to 'android' String" do + subject.provider = 'android' + subject.unregister_device("new_device_token") + FakeWeb.last_request.path.should == "/api/apids/new_device_token" + subject.provider = nil + end + + it "uses the android interface if :provider Symbol key is passed with an :android Symbol value" do subject.unregister_device("new_device_token", :provider => :android) FakeWeb.last_request.path.should == "/api/apids/new_device_token" end + it "uses the android interface if :provider Symbol key is passed with an 'android' String value" do + subject.unregister_device("new_device_token", :provider => "android") + FakeWeb.last_request.path.should == "/api/apids/new_device_token" + end + end describe "::delete_scheduled_push" do before(:each) do subject.application_key = "my_app_key" @@ -551,10 +576,10 @@ subject.application_key = "my_app_key2" subject.master_secret = "my_master_secret2" subject.push.success?.should == false end - it "converts aliases to strints" do + it "converts aliases to strings" do subject.push(@valid_params.merge(:aliases => [:one, 2])) request_json['aliases'].should == ['one', '2'] end end