Commit a9151d1

mo <mo.khan@gmail.com>
2017-12-24 05:36:09
add spec for metadata endpoint.
1 parent e0fe6aa
Changed files (2)
app/controllers/metadata_controller.rb
@@ -14,6 +14,6 @@ class MetadataController < ApplicationController
   end
 
   def ssl_configured?
-    !Rails.env.development?
+    Rails.env.production?
   end
 end
spec/requests/metadata_controller_spec.rb
@@ -0,0 +1,13 @@
+require 'rails_helper'
+
+describe MetadataController do
+  describe "#show" do
+    it 'returns the metadata' do
+      get '/metadata'
+
+      expect(response).to have_http_status(:ok)
+      metadata = Saml::Kit::Metadata.from(response.body)
+      expect(metadata.entity_id).to eql(Saml::Kit.configuration.issuer)
+    end
+  end
+end