Skip to content

Commit

Permalink
Add Jasmine test for i18n-js library
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzokuken authored and jywarren committed Nov 4, 2016
1 parent 3355e83 commit 9481674
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spec/javascripts/plots2_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("Plots2", function() {
if (object.url == '/likes/node/1/create') response = "4";
else response = 'none';

// check this if you have trouble faking a server response:
// check this if you have trouble faking a server response:
if (response != 'none'){
console.log('Faked response to:', object.url);
console.log(response);
Expand All @@ -53,7 +53,7 @@ describe("Plots2", function() {

$('#like-button-1').trigger('click');

// should trigger the following and our ajaxSpy should return a fake response of "4":
// should trigger the following and our ajaxSpy should return a fake response of "4":
// jQuery.getJSON("/likes/node/1/create", {}, function() { ...
// then triggering like.js code

Expand Down Expand Up @@ -96,6 +96,10 @@ describe("Plots2", function() {

$('#answer-0-expand').trigger('click');
expect($('#answer-0-expand').css('display')).toEqual('none');
})
});

it("loads up i18n-js library properly", function() {
expect(I18n.t('js.dashboard.selected_updates')).toBe('Selected updates')
});

});

0 comments on commit 9481674

Please sign in to comment.