From d0d946e1f6d32f5eb4fe5af6403366f50822a156 Mon Sep 17 00:00:00 2001 From: Kevin VanGelder Date: Wed, 21 Jan 2015 16:23:45 -0800 Subject: [PATCH] added tests --- spec/unit/screen_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/unit/screen_spec.rb b/spec/unit/screen_spec.rb index 4400e16..e7c9ce6 100644 --- a/spec/unit/screen_spec.rb +++ b/spec/unit/screen_spec.rb @@ -82,6 +82,13 @@ describe "screen properties" do parent_screen.navigationController.shouldAutorotate end + it "#should_autorotate shouldn't crash when NavigationController's visibleViewController is nil" do + parent_screen = BasicScreen.new(nav_bar: true) + parent_screen.open @screen, animated: false + @screen.navigationController.mock!(:visibleViewController) { nil } + parent_screen.navigationController.shouldAutorotate + end + # <= iOS 5 only it "#should_rotate(orientation) should fire when shouldAutorotateToInterfaceOrientation(orientation) fires" do @screen.mock!(:should_rotate) { |orientation| orientation.should == UIInterfaceOrientationMaskPortrait }