Working test for new iOS 7 tintColor

This commit is contained in:
Mark Rickert
2013-09-30 14:47:52 -04:00
parent 52aa0a505b
commit eabf8113bc
2 changed files with 15 additions and 9 deletions

View File

@@ -10,6 +10,8 @@ class TestDelegateRed < TestDelegateColored
tint_color UIColor.redColor
end
class TestDelegateBlack < TestDelegateColored
tint_color UIColor.blackColor
end
# Other colors
# class TestDelegateBlack < TestDelegateColored
# tint_color UIColor.blackColor
# end

View File

@@ -99,17 +99,21 @@ describe "PM::Delegate" do
end
describe "PM::Delegate Colors" do
it 'should set the application tint color' do
before do
@subject = TestDelegateRed.new
@map = TestMapScreen.new modal: true, nav_bar: true
@map.view_will_appear(false)
@subject.open @map
end
@subject.mock!(:on_load) do |app, options|
app.windows.first.rootViewController.view.tintColor.should == UIColor.redColor
it 'should set the application tint color on iOS 7' do
if UIDevice.currentDevice.systemVersion.to_f >= 7.0
@map.view.tintColor.should == UIColor.redColor
else
1.should == 1
end
@subject.application(UIApplication.sharedApplication, didFinishLaunchingWithOptions:nil)
end
end