Skip to content

Instantly share code, notes, and snippets.

@alejandroiglesias
Last active August 29, 2015 13:56
Show Gist options
  • Save alejandroiglesias/9194661 to your computer and use it in GitHub Desktop.
Save alejandroiglesias/9194661 to your computer and use it in GitHub Desktop.
it('can export budget level', inject(function(DownloadGeneratedFile, TestToolbox) {
var token = 123,
downloadUrl = DownloadGeneratedFile.budgetLevel(PROPOSAL_ID, BUDGET_1_ID).url;
scope.start_loader = angular.noop;
$httpBackend.expectGET(downloadUrl).respond({status: 'pending', token: token});
scope.downloadBudgetLevel(BUDGET_1_ID);
TestToolbox.httpBackendFlush($httpBackend);
// TODO: Should add more expectations when the DownloadManager is reworked.
// expect(_downloader.downloaded.url).toEqualData();
// expect(_mixpanel.analytics.track.eventName).toEqualData('Proposal: download budget level');
// expect(_mixpanel.analytics.track.properties.proposalId).toEqualData(PROPOSAL_ID);
// expect(_mixpanel.analytics.track.properties.budgetLevelId).toEqualData(BUDGET_1_ID);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment