spec/unit/view_helper_spec.rb in ProMotion-1.1.2 vs spec/unit/view_helper_spec.rb in ProMotion-1.2.0
- old
+ new
@@ -54,23 +54,40 @@
layered_view.contentMode.should == UIViewContentModeBottom
layered_view.layer.backgroundColor.should == UIColor.redColor.CGColor
end
- describe "content height" do
+ context "content sizing" do
before do
@child = UIView.alloc.initWithFrame([[20,100],[300,380]])
@dummy.addSubview @child
end
- it "should return content height" do
- @dummy.content_height(@dummy).should == 480
+ describe "content_height" do
+
+ it "should return content height" do
+ @dummy.content_height(@dummy).should == 480
+ end
+
+ it "should ignore hidden subviews" do
+ @child.hidden = true
+ @dummy.content_height(@dummy).should == 0
+ end
+
end
- it "should ignore hidden subviews" do
- @child.hidden = true
- @dummy.content_height(@dummy).should == 0
+ describe "content_width" do
+
+ it "should return content width" do
+ @dummy.content_width(@dummy).should == 320
+ end
+
+ it "should ignore hidden subviews" do
+ @child.hidden = true
+ @dummy.content_width(@dummy).should == 0
+ end
+
end
end
describe "set_easy_attributes" do