'use strict';

describe('firebaseAuth', function(){
  var firebaseAuth = require('app/core/firebase/firebase-auth');

  var authObj,
      $firebaseAuth,
      firebaseRef;


  beforeEach(function(){
    authObj = {};
    $firebaseAuth = sinon.stub().returns(authObj);
    firebaseRef = {};

    angular.mock.module(function($provide){
      $provide.value('$firebaseAuth', $firebaseAuth);
      $provide.value('firebaseRef', firebaseRef);
      $provide.factory('firebaseAuth', firebaseAuth);
    });
  });


  it('should call $firebaseAuth with a firebase reference', inject(function(firebaseAuth){ // eslint-disable-line no-unused-vars
    expect($firebaseAuth.callCount).toBe(1);
    expect($firebaseAuth.calledWith(firebaseRef)).toBe(true);
  }));

  it('should return a firebase auth object', inject(function(firebaseAuth){
    expect(firebaseAuth).toBe(authObj);
  }));

});
