spec/ios/view_spec.rb in teacup-2.1.8 vs spec/ios/view_spec.rb in teacup-2.1.9

- old
+ new

@@ -19,10 +19,35 @@ style :label, text: "Stylesheet1 Label1" style :new_style, text: 'new style' + + style :constrained, + constraints: [ + [:full] + ] + end + end + + describe 'reset_constraints' do + + before do + @outer = UIView.new + @outer.addSubview @view + end + + it "forgets the list of constraints that may have been set" do + @view.stylesheet = @stylesheet + @view.add_style_class :constrained + @view.apply_constraints + @view.constraints.should.not.be.empty + @outer.reset_constraints + @view.apply_constraints + @view.constraints.should.be.empty + end + end describe 'stylename=' do it 'should work' do @view.stylename = :label