Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed one test

  • Loading branch information...
commit 9460b15091983ea4fce6e564525d2ae3cda04e8c 1 parent c3030fb
@francois2metz authored
Showing with 18 additions and 20 deletions.
  1. +6 −10 spec/node.js
  2. +12 −10 spec/spec.plugins.facebook.js
View
16 spec/node.js
@@ -1,20 +1,16 @@
-require.paths.unshift('spec', '/opt/local/lib/ruby/gems/1.8/gems/jspec-3.3.2/lib', 'lib')
-require.paths.unshift('spec', 'lib', 'spec/lib')
+require.paths.unshift('/home/francois/.gem/ruby/1.8/gems/jspec-4.3.3/lib')
require.paths.unshift(__dirname + '/../lib')
-require.paths.unshift(__dirname + '/../lib/support')
-require.paths.unshift(__dirname + '/../lib/support/express/lib')
-require('jspec')
-require("express")
-require("express/spec")
+var JSPEC = require('jspec');
+var express = require("express")
-print = puts
+print = require('sys').puts
quit = process.exit
-Express.environment = 'test'
+//Express.environment = 'test'
JSpec
- .exec('./spec.plugins.facebook.js')
+ .exec(__dirname +'/spec.plugins.facebook.js')
.run({ reporter: JSpec.reporters.Terminal, fixturePath: 'spec/fixtures' })
.report()
View
22 spec/spec.plugins.facebook.js
@@ -1,20 +1,22 @@
describe 'Express'
before_each
- reset()
facebook = require('facebook')
- use(facebook.Facebook, {
+ var express = require('express')
+ var querystring = require('querystring')
+ app = express.createServer();
+ app.use(facebook.Facebook, {
apiKey: 'e1249f7d4bc25b8f90e5c9c7523e3ee1',
apiSecret: '4ae45734dd66fa85c7b189fc2d7d5b4c'
})
- validCookies = {
- "e1249f7d4bc25b8f90e5c9c7523e3ee1": "5b820bb72e780318acb26ff375db4cc9",
- "e1249f7d4bc25b8f90e5c9c7523e3ee1_user": "687215451",
- "e1249f7d4bc25b8f90e5c9c7523e3ee1_ss": "lWYbyFp0GP8e7BgPa1aLDg__",
- "e1249f7d4bc25b8f90e5c9c7523e3ee1_session_key": "3.LIysipyTte6aXFBcStEixg__.3600.1267714800-687215451",
- "e1249f7d4bc25b8f90e5c9c7523e3ee1_expires": "1267714800"
- }
+ validCookies = {"e1249f7d4bc25b8f90e5c9c7523e3ee1": querystring.stringify({
+ "sig" : "e",
+ "user":"687215451",
+ "ss":"lWYbyFp0GP8e7BgPa1aLDg__",
+ "session_key":"3.LIysipyTte6aXFBcStEixg__.3600.1267714800-687215451",
+ "expires":"1267714800"
+ })}
tamperedCookies = {
"e1249f7d4bc25b8f90e5c9c7523e3ee1": "5b820bb72e780318acb26ff375db4cc9",
@@ -78,7 +80,7 @@ describe 'Express'
it 'should return a well formatted fingerprint'
var fingerprint = facebook.getFingerprintForCookie('e1249f7d4bc25b8f90e5c9c7523e3ee1', validCookies)
- fingerprint.should.eql("expires=1267714800session_key=3.LIysipyTte6aXFBcStEixg__.3600.1267714800-687215451ss=lWYbyFp0GP8e7BgPa1aLDg__user=687215451")
+fingerprint.should.eql({fingerprint: "expires=1267714800session_key=3.LIysipyTte6aXFBcStEixg__.3600.1267714800-687215451ss=lWYbyFp0GP8e7BgPa1aLDg__user=687215451", sig: "e"})
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.