spec/functional/func_screen_spec.rb in ProMotion-2.0.0 vs spec/functional/func_screen_spec.rb in ProMotion-2.0.1

- old
+ new

@@ -66,9 +66,28 @@ wait 0.5 do basic.animation_ts.should.be < 0.2 end end + it "should call the on_back method on the root controller when navigating back" do + @nav_screen = NavigationScreen.new nav_bar: true + @presented_screen = PresentScreen.new + @nav_screen.open @presented_screen + @presented_screen.close + @nav_screen.on_back_fired.should == true + end + + it "should call the correct on_back method when nesting screens" do + @base_screen = NavigationScreen.new nav_bar: true + @child_screen = @base_screen.open NavigationScreen.new + @grandchild_screen = @child_screen.open NavigationScreen.new + + # start closing + @grandchild_screen.close + @child_screen.on_back_fired.should == true + @child_screen.close + @base_screen.on_back_fired.should == true + end it "should allow opening and closing a modal screen" do @basic = BasicScreen.new(nav_bar: true) wait 0.1 do @controller.open_modal @basic