spec/functional/func_screen_spec.rb in ProMotion-1.0.4 vs spec/functional/func_screen_spec.rb in ProMotion-1.1.0.rc1

- old
+ new

@@ -4,11 +4,11 @@ # Override controller to properly instantiate def controller rotate_device to: :portrait, button: :bottom @controller ||= FunctionalScreen.new(nav_bar: true) @root_screen = @controller - @controller.navigation_controller + @controller.navigationController end after do @controller = nil @root_screen = nil @@ -42,12 +42,35 @@ wait 0.5 do view("Functional").should.be.kind_of UINavigationItemView end end + end + it "should push another screen with animation by default" do + basic = @root_screen.open BasicScreen + wait 0.5 do + basic.animation_ts.should.be > 0.2 + end + end + + it "should push another screen with animation when animated: true" do + basic = @root_screen.open BasicScreen, animated: true + wait 0.5 do + basic.animation_ts.should.be > 0.2 + end + end + + it "should push another screen without animation when animated: false" do + basic = @root_screen.open BasicScreen, animated: false + wait 0.5 do + basic.animation_ts.should.be < 0.2 + end + end + + it "should allow opening and closing a modal screen" do @basic = BasicScreen.new(nav_bar: true) wait 0.1 do @root_screen.open_modal @basic @@ -89,22 +112,22 @@ end end end it "should pop to the root view controller" do - @root_vc = @controller.navigation_controller.visibleViewController - @controller.navigation_controller.viewControllers.count.should == 1 + @root_vc = @controller.navigationController.visibleViewController + @controller.navigationController.viewControllers.count.should == 1 @controller.open BasicScreen.new wait 0.6 do @controller.open BasicScreen.new wait 0.6 do @controller.open BasicScreen.new wait 0.6 do - @controller.navigation_controller.viewControllers.count.should == 4 + @controller.navigationController.viewControllers.count.should == 4 @controller.close to_screen: :root wait 0.6 do - @controller.navigation_controller.viewControllers.count.should == 1 - @controller.navigation_controller.topViewController.should == @root_vc + @controller.navigationController.viewControllers.count.should == 1 + @controller.navigationController.topViewController.should == @root_vc end end end end end