/* global describe, it, expect, before */
/* jshint expr: true */

var chai = require('chai')
  , FacebookStrategy = require('../lib/strategy');


describe('Strategy', function() {
    
  var strategy = new FacebookStrategy({
      clientID: 'ABC123',
      clientSecret: 'secret'
    },
    function() {});
  
  describe('handling a request to be redirected with display param', function() {
    var url;
  
    before(function(done) {
      chai.passport.use(strategy)
        .redirect(function(u) {
          url = u;
          done();
        })
        .req(function(req) {
        })
        .authenticate({ display: 'mobile' });
    });
  
    it('should be redirected', function() {
      expect(url).to.equal('https://www.facebook.com/dialog/oauth?display=mobile&response_type=code&redirect_uri=&client_id=ABC123');
    });
  });
  
  describe('handling a request to be redirected with reauthorization params', function() {
    var url;
  
    before(function(done) {
      chai.passport.use(strategy)
        .redirect(function(u) {
          url = u;
          done();
        })
        .req(function(req) {
        })
        .authenticate({ authType: 'reauthenticate', authNonce: 'foo123' });
    });
  
    it('should be redirected', function() {
      expect(url).to.equal('https://www.facebook.com/dialog/oauth?auth_type=reauthenticate&auth_nonce=foo123&response_type=code&redirect_uri=&client_id=ABC123');
    });
  });
  
});

@@ -178,13 +178,9 @@
 ) %7B%0A
-    
 %0A
+
   va
@@ -293,27 +293,25 @@
 tion() %7B%7D);%0A
-  
 %0A
+
   describe('
@@ -385,35 +385,33 @@
  %7B%0A    var url;%0A
-  
 %0A
+
     before(funct
@@ -622,35 +622,33 @@
 le' %7D);%0A    %7D);%0A
-  
 %0A
+
     it('should b
@@ -720,32 +720,37 @@
 ww.facebook.com/
+v2.1/
 dialog/oauth?dis
@@ -828,19 +828,17 @@
 ;%0A  %7D);%0A
-  
 %0A
+
   descri
@@ -933,19 +933,17 @@
 ar url;%0A
-  
 %0A
+
     befo
@@ -1200,19 +1200,17 @@
     %7D);%0A
-  
 %0A
+
     it('
@@ -1298,16 +1298,21 @@
 ook.com/
+v2.1/
 dialog/o
@@ -1426,15 +1426,13 @@
 ;%0A  %7D);%0A
-  
 %0A%7D);%0A

Fix tests