daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Oct 17th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe("MR.TopicsLinkView", function() {
  2.   var ui, controller, view, topic;
  3.  
  4.   beforeEach(function() {
  5.     ui = {};
  6.  
  7.     controller = MR.TopicsController.create();
  8.     topic = MR.Topic.createRecord();
  9.  
  10.     Em.run(function() {
  11.       view = MR.TopicsLinkView.create({
  12.         controller: controller,
  13.         topic: topic
  14.       });
  15.       view.appendTo('#jasmine_content');
  16.     });
  17.   });
  18.  
  19.   afterEach(function() {
  20.     view.destroy();
  21.   });
  22.  
  23.   describe("drag n drop", function() {
  24.     describe("drag", function() {
  25.       it("sets the dragging topic to itself", function() {
  26.         spyOn(controller, 'setDraggingTopic');
  27.  
  28.         view.$().trigger('dragstart', ui);
  29.  
  30.         expect(controller.setDraggingTopic).emberToHaveBeenCalledWith(topic);
  31.       });
  32.     });
  33.  
  34.     describe("drop", function() {
  35.       it("saves the dropped topic", function() {
  36.         spyOn(controller, 'saveDraggingAfter');
  37.  
  38.         view.$().trigger('drop', ui);
  39.  
  40.         expect(controller.saveDraggingAfter).emberToHaveBeenCalledWith(topic);
  41.       });
  42.     });
  43.   });
  44. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top