/* Copyright (c) 2010, Diaspora Inc. This file is * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ describe("mobile interface", function() { describe("initialize", function() { it("attaches a change event to the select box", function() { spyOn($.fn, 'change'); Mobile.initialize(); expect($.fn.change).toHaveBeenCalledWith(Mobile.changeAspect); expect($.fn.change.mostRecentCall.object.selector).toEqual("#aspect_picker"); }); }); describe("change", function() { it("changes to the aspect show page", function() { $('#jasmine_content').html( ''); spyOn(Mobile, "windowLocation"); $.proxy(Mobile.changeAspect, $('#aspect_picker > option').first())() expect(Mobile.windowLocation).toHaveBeenCalledWith("/aspects/family-aspect-id"); }); }); });