From 9dcae48c6ce66ff2c760aff47c8ddf261e9875b5 Mon Sep 17 00:00:00 2001 From: souravirus Date: Mon, 9 Jul 2018 00:48:01 +0530 Subject: [PATCH] made the click function above the jquery function in plots_spec --- spec/javascripts/plots2_spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/javascripts/plots2_spec.js b/spec/javascripts/plots2_spec.js index 289de7d6773..31d6c3a7a59 100644 --- a/spec/javascripts/plots2_spec.js +++ b/spec/javascripts/plots2_spec.js @@ -37,6 +37,8 @@ describe("Plots2", function() { }); + $('#like-button-1').trigger('click'); + // should trigger the following and our ajaxSpy should return a fake response of "4": var response; jQuery.getJSON("/likes/node/1/create").done(function(data){ @@ -44,7 +46,6 @@ describe("Plots2", function() { }); // then triggering like.js code - $('#like-button-1').trigger('click'); expect(response).to.eql('4'); //expect($('#like-count-1').html()).to.eql('4'); // passing