orbit-basic/spec/models/app_auth_spec.rb

81 lines
3.4 KiB
Ruby
Raw Permalink Normal View History

# require 'spec_helper'
# require 'ruby-debug'
2011-12-23 10:34:21 +00:00
# describe AppAuth do
2011-12-23 10:34:21 +00:00
# before(:all) do
# @app_ary = [
# {"name" => "G_app_1" , "all" => false,"blockusers" => ["a_bad_stud@rulingcom.com"]},
# {"name" => "G_app_2" , "all" => true,"blockusers" => ["a_bad_stud@rulingcom.com"]},
# {"name" => "G_app_3_for_bad" , "all" => true,"blockusers" => []}
# ]
2011-12-23 10:34:21 +00:00
# @app_ary.each do |t|
# a = ModuleApp.new :title => t["name"]
# blocked_users = t["blockusers"].collect do |b_user|
# User.first(conditions:{email:b_user})
# end
# a.create_app_auth :all=> t["all"],:blocked_users => blocked_users
# a.save!
# end
# @good_stud_become_bad = User.first(conditions:{email:"a_good_stud@rulingcom.com"})
# @bad_stud_become_good = User.first(conditions:{email:"a_bad_stud@rulingcom.com"})
# @g_app_1 = ModuleApp.first(conditions:{title:"G_app_1"})
# @g_app_2 = ModuleApp.first(conditions:{title:"G_app_2"})
# @g_app_3 = ModuleApp.first(conditions:{title:"G_app_3_for_bad"})
# end
2011-12-23 10:34:21 +00:00
# describe "[Init status check]" do
# it "bad_stud_become_good status " do
# @bad_stud_become_good.avb_apps.should_not include @g_app_1.app_auth
# @bad_stud_become_good.avb_apps.should_not include @g_app_2.app_auth
# @bad_stud_become_good.avb_apps.should include @g_app_3.app_auth
# end
2011-12-23 10:34:21 +00:00
# it "good_stud_become_bad status " do
# @good_stud_become_bad.avb_apps.should_not include @g_app_1.app_auth
# @good_stud_become_bad.avb_apps.should include @g_app_2.app_auth
# @good_stud_become_bad.avb_apps.should include @g_app_3.app_auth
# end
# end
2011-12-23 10:34:21 +00:00
# describe ".add_user_to_black_list sutd" do
# it "When good stud is blocked with app1 and app2" do
# @g_app_1.app_auth.add_user_to_black_list @good_stud_become_bad
# @g_app_2.app_auth.add_user_to_black_list @good_stud_become_bad
# @good_stud_become_bad.avb_apps.should_not include @g_app_1.app_auth
# @good_stud_become_bad.avb_apps.should_not include @g_app_2.app_auth
# end
# end
2011-12-23 10:34:21 +00:00
# describe ".remove_user_from_black_list sutd" do
# it "When bad stud is authed with app1 and app2" do
# @g_app_1.app_auth.remove_user_from_black_list @bad_stud_become_good
# @g_app_2.app_auth.remove_user_from_black_list @bad_stud_become_good
# #@bad_stud_become_good.avb_apps.should include @g_app_1.app_auth
# @bad_stud_become_good.avb_apps.should include @g_app_2.app_auth
# end
# end
2011-12-23 10:34:21 +00:00
# describe ".add_user_to_privilege_list sutd" do
# it "When bad stud is auth for one more app" do
# @bad_stud_become_good.avb_apps.should_not include @g_app_1.app_auth #shouldn't have at first time since app1 is not sat for all
# @g_app_1.app_auth.add_user_to_privilege_list @bad_stud_become_good #change status
# @bad_stud_become_good.avb_apps.should include @g_app_1.app_auth #check
# end
# end
2011-12-23 10:34:21 +00:00
# describe ".remove_user_from_privilege_list sutd" do
# it "admin mistake. remove user from privilege list" do
# @g_app_1.app_auth.remove_user_from_privilege_list @bad_stud_become_good
# @bad_stud_become_good.avb_apps.should_not include @g_app_1.app_auth
# end
# end
2011-12-23 10:34:21 +00:00
# after(:all) do
# @app_ary.each do |item|
# ModuleApp.first(conditions: {title: item["name"]}).destroy
# end
# end
2011-12-23 10:34:21 +00:00
# end