From dfb48d343fdda7062e838c3ea319e4e1dcff3383 Mon Sep 17 00:00:00 2001
From: Ilya Zhitomirskiy <ilya@laptop.(none)>
Date: Tue, 14 Jun 2011 17:34:27 -0700
Subject: [PATCH] config in chubbies and blank public key check ms iz

---
 spec/chubbies/app.rb                               | 3 +++
 spec/chubbies/config.ru                            | 1 +
 spec/controllers/authorizations_controller_spec.rb | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/spec/chubbies/app.rb b/spec/chubbies/app.rb
index 04f4bcdb4d..fd4774f006 100644
--- a/spec/chubbies/app.rb
+++ b/spec/chubbies/app.rb
@@ -40,6 +40,9 @@ module Chubbies
     has_one :access_token, :class_name => "DiasporaClient::AccessToken", :dependent => :destroy
   end
 
+  DiasporaClient.config do |d|
+    d.private_key_path = File.dirname(__FILE__) + "/chubbies.private.pem"
+  end
 
   class App < DiasporaClient::App
     def current_user
diff --git a/spec/chubbies/config.ru b/spec/chubbies/config.ru
index 6a2479450e..781e7cad41 100644
--- a/spec/chubbies/config.ru
+++ b/spec/chubbies/config.ru
@@ -1,4 +1,5 @@
 require  File.dirname(__FILE__) + '/app'
 require "bundler/setup"
 
+
 run Chubbies::App
diff --git a/spec/controllers/authorizations_controller_spec.rb b/spec/controllers/authorizations_controller_spec.rb
index 7f958366f2..c0ca0b3a43 100644
--- a/spec/controllers/authorizations_controller_spec.rb
+++ b/spec/controllers/authorizations_controller_spec.rb
@@ -107,6 +107,10 @@ describe AuthorizationsController do
       @controller.should_receive(:valid_nonce?).with(@nonce)
       @controller.verify(Base64.encode64(@signable_string), @sig, 'public_key!')
     end
+
+    it 'checks for public key' do
+      @controller.verify(Base64.encode64(@signable_string), @sig, '').should == "blank public key"
+    end
   end
 
   describe '#verify_signature' do
-- 
GitLab