Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("MR.TopicsLinkView", function() {
- var ui, controller, view, topic;
- beforeEach(function() {
- ui = {};
- controller = MR.TopicsController.create();
- topic = MR.Topic.createRecord();
- Em.run(function() {
- view = MR.TopicsLinkView.create({
- controller: controller,
- topic: topic
- });
- view.appendTo('#jasmine_content');
- });
- });
- afterEach(function() {
- view.destroy();
- });
- describe("drag n drop", function() {
- describe("drag", function() {
- it("sets the dragging topic to itself", function() {
- spyOn(controller, 'setDraggingTopic');
- view.$().trigger('dragstart', ui);
- expect(controller.setDraggingTopic).emberToHaveBeenCalledWith(topic);
- });
- });
- describe("drop", function() {
- it("saves the dropped topic", function() {
- spyOn(controller, 'saveDraggingAfter');
- view.$().trigger('drop', ui);
- expect(controller.saveDraggingAfter).emberToHaveBeenCalledWith(topic);
- });
- });
- });
- });
Add Comment
Please, Sign In to add comment