From 51881fa3fbc054102c76824ae37c6f6bccfa4a1e Mon Sep 17 00:00:00 2001 From: leenasn Date: Mon, 16 Nov 2015 19:04:52 +0530 Subject: [PATCH] Add GCM push for pushing OneMDM app to devices - Add dashboard showing the status of installations - Add default status as 'pushed' for installation - Add has_many relations for installations for app and device models - Add logic to read the APP URL from config file --- spec/models/app_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/models/app_spec.rb diff --git a/spec/models/app_spec.rb b/spec/models/app_spec.rb new file mode 100644 index 0000000..52f04db --- /dev/null +++ b/spec/models/app_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +RSpec.describe App, type: :model do + + let!(:app) { create(:app) } + + it { should validate_presence_of :name } + it { should validate_presence_of :package_name } + + describe "APK URL" do + it "Default app" do + app = create(:app) + expect(app.apk_url).to eql(DEFAULT_APP_APK_URL) + end + it "Non Default app" do + app = App.create(name: "Non MDM", package_name: "com.nonmdm") + expect(app.apk_url).to eql("") + end + + end +end