Browse files

added test for showLocation publisher view function

  • Loading branch information...
1 parent a19e331 commit 8bd82161de0f007b96ed9e2cec0acf519d1bdc48 @marco-gallardo marco-gallardo committed Apr 13, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 spec/javascripts/app/views/publisher_view_spec.js
View
18 spec/javascripts/app/views/publisher_view_spec.js
@@ -75,6 +75,24 @@ describe("app.views.Publisher", function() {
});
describe('#showLocation', function(){
+ it("Show location", function(){
+
+ // inserts location to the DOM; it is the location's view element
+ setFixtures('<div id="publisher_textarea_wrapper"></container>');
+
+ // creates a fake Locator to avoid google API call
+ Google = {};
+ Google.Locator = function(){return { getAddress:function(){}}};
+
+ // validates there is not location
+ expect($("#location").length).toBe(0);
+
+ // this should create a new location
+ this.view.showLocation();
+
+ // validates there is one location created
+ expect($("#location").length).toBe(1);
+ })
});
describe('#destroyLocation', function(){

0 comments on commit 8bd8216

Please sign in to comment.