Skip to content

Instantly share code, notes, and snippets.

@jaseflow
Created August 21, 2015 03:06
Show Gist options
  • Select an option

  • Save jaseflow/02e43a89910385b99ff2 to your computer and use it in GitHub Desktop.

Select an option

Save jaseflow/02e43a89910385b99ff2 to your computer and use it in GitHub Desktop.
"use strict";
describe("ListController", function() {
beforeEach(module("dashboard"));
var $controller;
beforeEach(inject(function(_$controller_) {
$controller = _$controller_;
}));
describe("$scope.displayType", function() {
var $scope,
controller;
beforeEach(function() {
$scope = {};
controller = $controller("ListCtrl", {$scope: $scope});
});
it("changes from list to grid", function() {
$scope.displayType = "list";
$scope.toggleView();
expect($scope.displayType).toEqual("grid");
});
it("changes from grid to list", function() {
$scope.displayType = "grid";
$scope.toggleView();
expect($scope.displayType).toEqual("list");
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment