 				layer.style.backgroundColor.should.equal new Color("red").toString()
 				done()
 
-			layer.states.switch "stateA"
+			layer.animateTo "stateA"
 
 		it "should set non and numeric properties with animation", (done) ->
 
 			layer = new Layer
-			layer.states.add
+			layer.states =
 				stateA: {x:200, backgroundColor:"red"}
 
 			# layer.scroll.should.equal false

		it "should set defaults", ->

			layer = new Layer
			layer.states.add "test", {x:123}
			layer.states.switch "test"

			layer.states._animation.options.curve.should.equal Framer.Defaults.Animation.curve

			Framer.Defaults.Animation =
				curve: "spring(1, 2, 3)"

			layer = new Layer
			layer.states.add "test", {x:456}
			layer.states.switch "test"

			layer.states._animation.options.curve.should.equal "spring(1, 2, 3)"

			Framer.resetDefaults()

		it "should convert string to colors in states", ->
			layer = new Layer
			layer.states.add
				test:
					backgroundColor:"fff"
					color: "000"
			layer.states._states.test.backgroundColor.isEqual(new Color("fff")).should.be.true
			layer.states._states.test.color.isEqual(new Color("000")).should.be.true




		it "should set scroll property", ->

			layer = new Layer
			layer.states =
				stateA: {scroll:true}
				stateB: {scroll:false}

			layer.animateTo "stateA", instant: true
			layer.scroll.should.equal true

			layer.animateTo "stateB", instant: true
			layer.scroll.should.equal false

			layer.animateTo "stateA", instant: true
			layer.scroll.should.equal true

		it "should set non numeric properties with animation", (done) ->

			layer = new Layer
			layer.states =
				stateA: {scroll:true, backgroundColor:"red"}

			layer.scroll.should.equal false
