Commit bd9a6422

mo khan <mo@mokhan.ca>
2014-07-08 03:11:25
add spec for public url.
1 parent d1ef295
Changed files (1)
spec
javascripts
backbone
spec/javascripts/backbone/models/cake_spec.js.coffee
@@ -33,3 +33,9 @@ describe "CakeSide.Models.Cake", ->
       cake = createSUT(attributes)
       expect(cake.validate(attributes)).toBeUndefined()
       expect(cake.isValid()).toBeTruthy()
+
+  describe "#public_url", ->
+    it "returns the correct url", ->
+      result = createSUT(slug: '123-cake').public_url()
+      expect(result).toMatch(/^http:\/\/.+\/creations\/123-cake$/)
+