Sha256: 275e30efdf29514b6a3372bbb020f7632d4b9da4d5c1ff1f2139d753522a4dc9

Contents?: true

Size: 1.2 KB

Versions: 7

Compression:

Stored size: 1.2 KB

Contents

describe "tab bar functionality" do

  before do
    @app = TestDelegate.new

    @tab_1 = TabScreen.new
    @tab_2 = BasicScreen.new
    @tab_3 = HomeScreen.new
    @tab_4 = TestTableScreen.new

    @tab_bar = @app.open_tab_bar @tab_1, @tab_2, @tab_3, @tab_4
  end

  after do

  end

  it "should have created a tab bar with four items" do
    @tab_bar.should != nil
    @tab_bar.should.be.kind_of(UITabBarController)
    @tab_bar.viewControllers.length.should == 4
  end

  it "should have set a custom tab bar item" do
    @tab_bar.tabBar.items.first.title.should == "Tab Item"
  end

  it "should have set the others to their respective titles" do
    @tab_bar.tabBar.items[1].title.should == "Basic"
    @tab_bar.tabBar.items[2].title.should == "Home"
    @tab_bar.tabBar.items[3].title.should == "TestTableScreen"
  end

  it "should allow changing the tab bar item with set_tab_bar_item" do
    @tab_1.set_tab_bar_item title: "Custom", item: "test.jpeg"
    @tab_bar.tabBar.items.first.title.should == "Custom"
  end

  it "should allow replacing a view controller with `open`" do
    new_screen = BasicScreen.new
    @tab_4.open new_screen, in_tab: "Home"
    @tab_bar.viewControllers[2].should == new_screen
  end

end


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ProMotion-2.0.1 spec/unit/tab_spec.rb
ProMotion-2.0.0 spec/unit/tab_spec.rb
ProMotion-2.0.0.rc5 spec/unit/tab_spec.rb
ProMotion-2.0.0.rc4 spec/unit/tab_spec.rb
ProMotion-2.0.0.rc3 spec/unit/tab_spec.rb
ProMotion-2.0.0.rc2 spec/unit/tab_spec.rb
ProMotion-2.0.0.rc1 spec/unit/tab_spec.rb