           host: 'localhost'
 
       it "handles a group without subdomain on localhost", ->
-        expect(@subject.group(@group)).toBe 'http://localhost:3000/g/key/name'
+        expect(@subject.group(@group)).toBe "http://localhost:3000/g/#{@group.key}/name"
 
       it "handles a group with subdomain on localhost", ->
         @group.updateFromJSON subdomain: 'subdomain'
-        expect(@subject.group(@group)).toBe 'http://subdomain.localhost:3000/'
+        expect(@subject.group(@group)).toBe "http://subdomain.localhost:3000/"
 
       it "handles a subgroup with subdomain on localhost", ->
         @group.updateFromJSON subdomain: 'subdomain'
         subgroup = @factory.create 'groups', parent_id: @group.id, key: 'subkey', name: 'subname'
-        expect(@subject.group(subgroup)).toBe 'http://subdomain.localhost:3000/g/subkey/name-subname'
+        expect(@subject.group(subgroup)).toBe "http://subdomain.localhost:3000/g/#{subgroup.key}/name-subname"
 
     describe 'on loom.io', ->
       beforeEach ->

          default_subdomain: null

      it 'handles a group without subdomain on loomio.anotherdomain.com', ->
        expect(@subject.group(@group)).toBe 'http://loomio.anotherdomain.com/g/key/name'

      it 'handles a group with subdomain on loomio.anotherdomain.com', ->
        @group.updateFromJSON subdomain: 'subdomain'
        expect(@subject.group(@group)).toBe 'http://subdomain.loomio.anotherdomain.com/'

      it 'handles a subgroup with subdomain on loomio.anotherdomain.com', ->
        @group.updateFromJSON subdomain: 'subdomain'
        subgroup = @factory.create 'groups', parent_id: @group.id, key: 'subkey', name: 'subname'
        expect(@subject.group(subgroup)).toBe 'http://subdomain.loomio.anotherdomain.com/g/subkey/name-subname'

          ssl: true

      it 'handles a group without subdomain on loom.io', ->
        expect(@subject.group(@group)).toBe "https://loom.io/g/#{@group.key}/name"

      it 'handles a group with subdomain on loom.io', ->
        @group.updateFromJSON subdomain: 'subdomain'
