diff --git a/lib/devise_saml_authenticatable/saml_config.rb b/lib/devise_saml_authenticatable/saml_config.rb index 704331d..b09ea52 100644 --- a/lib/devise_saml_authenticatable/saml_config.rb +++ b/lib/devise_saml_authenticatable/saml_config.rb @@ -14,7 +14,7 @@ def file_based_config return @file_based_config if @file_based_config idp_config_path = "#{Rails.root}/config/idp.yml" - if File.exists?(idp_config_path) + if File.exist?(idp_config_path) @file_based_config ||= OneLogin::RubySaml::Settings.new(YAML.load(File.read(idp_config_path))[Rails.env]) end end diff --git a/spec/devise_saml_authenticatable/saml_config_spec.rb b/spec/devise_saml_authenticatable/saml_config_spec.rb index 789b28c..166ee41 100644 --- a/spec/devise_saml_authenticatable/saml_config_spec.rb +++ b/spec/devise_saml_authenticatable/saml_config_spec.rb @@ -10,7 +10,7 @@ context "when config/idp.yml does not exist" do before do allow(Rails).to receive(:root).and_return("/railsroot") - allow(File).to receive(:exists?).with("/railsroot/config/idp.yml").and_return(false) + allow(File).to receive(:exist?).with("/railsroot/config/idp.yml").and_return(false) end it "is the global devise SAML config" do @@ -156,7 +156,7 @@ def self.settings(idp_entity_id) before do allow(Rails).to receive(:env).and_return("environment") allow(Rails).to receive(:root).and_return("/railsroot") - allow(File).to receive(:exists?).with("/railsroot/config/idp.yml").and_return(true) + allow(File).to receive(:exist?).with("/railsroot/config/idp.yml").and_return(true) allow(File).to receive(:read).with("/railsroot/config/idp.yml").and_return(idp_yaml) end