Sha256: 3db80446c791247f02b577885e02a77966ab5adc45a2c3b38c661481ed83664a
Contents?: true
Size: 1.74 KB
Versions: 5
Compression:
Stored size: 1.74 KB
Contents
describe 'The Controller Component', -> beforeEach -> controller = Luca.register 'Luca.components.SpecController' controller.extends 'Luca.components.Controller' controller.defines name: "spec_controller" defaultCard: 'one' rootComponent: true components:[ name: "one" type: "controller" components:[ name: "alpha" , name: "bravo" ] , name: "two" type: "controller" components:[ name: "charlie" , name: "delta" ] , name: "three" type: "controller" components:[ name: "echo" ] , name: "four" type: "view" ] @controller = new Luca.components.SpecController().render() it "should track the names of its pages", -> names = @controller.sectionNames() expect( names... ).toEqual 'one', 'two', 'three', 'four' it "should track the names of its controllers", -> names = _( @controller.controllers() ).pluck 'name' expect( names... ).toEqual 'one', 'two', 'three' it "should be stateful", -> expect( @controller.state ).toBeDefined() it "should track the active page", -> @controller.navigate_to("two") expect( @controller.activePage() ).toEqual 'two' it "should track controller activation events", -> two = @controller.navigate_to("two") expect( two.activatedByController ).toBeTruthy() it "should define a controllerPath method on each page", -> expect( @controller.activeComponent().controllerPath ).toBeDefined() it "should know the controller path", -> path = @controller.activeComponent().controllerPath() expect( path... ).toEqual "spec_controller", "one"
Version data entries
5 entries across 5 versions & 1 rubygems