spec/omnicontacts/middleware/oauth2_spec.rb in omnicontacts-0.1.5 vs spec/omnicontacts/middleware/oauth2_spec.rb in omnicontacts-0.1.6

- old
+ new

@@ -1,11 +1,11 @@ require "spec_helper" require "omnicontacts/middleware/oauth2" -describe OmniContacts::Middleware::OAuth2 do +describe OmniContacts::Middleware::OAuth2 do - before(:all) do + before(:all) do class OAuth2Middleware < OmniContacts::Middleware::OAuth2 def authorization_url "http://www.example.com" end @@ -16,26 +16,26 @@ def self.mock_session @mock_session ||= {} end def session - OAuth2Middleware.mock_session + OAuth2Middleware.mock_session end def fetch_access_token code - ["access_token", "token_type", "token_refresh"] + ["access_token", "token_type", "token_refresh"] end def fetch_contacts_using_access_token token, token_type [{:name => "John Doe", :email => "john@example.com"}] end end end let(:app) { Rack::Builder.new do |b| - b.use OAuth2Middleware, "client_id", "client_secret" - b.run lambda{ |env| [200, {"Content-Type" => "text/html"}, ["Hello World"]] } + b.use OAuth2Middleware, "client_id", "client_secret" + b.run lambda { |env| [200, {"Content-Type" => "text/html"}, ["Hello World"]] } end.to_app } context "visiting the listening path" do it "should redirect to authorization site when visiting the listening path" do