Sha256: af9fb1ce01784d3353d6b543071e92248df08f5a46e371e104491841b4ed859a
Contents?: true
Size: 1.08 KB
Versions: 5
Compression:
Stored size: 1.08 KB
Contents
require 'unit_spec_helper' require 'unit/notification_shared.rb' describe Rpush::Client::ActiveRecord::Wpns::Notification do it_should_behave_like 'an Notification subclass' let(:app) { Rpush::Client::ActiveRecord::Wpns::App.create!(name: 'test', auth_key: 'abc') } let(:notification_class) { Rpush::Client::ActiveRecord::Wpns::Notification } let(:notification) { notification_class.new } it "should have an url in the uri parameter" do notification = Rpush::Client::ActiveRecord::Wpns::Notification.new(uri: "somthing") notification.valid? notification.errors[:uri].include?("is invalid").should be_true end it "should be invalid if there's no data" do notification = Rpush::Client::ActiveRecord::Wpns::Notification.new(data: {}) notification.valid? notification.errors[:data].include?("can't be blank").should be_true end it "should be invalid if there's no alert" do notification = Rpush::Client::ActiveRecord::Wpns::Notification.new(alert: nil) notification.valid? notification.errors[:data].include?("can't be blank").should be_true end end
Version data entries
5 entries across 5 versions & 1 rubygems