 describe 'Github Repositories', ->
 
   beforeEach ->
+    loadFixtures('origin.html')
     @$element = $( '#fixtures' )
-    loadFixtures('origin.html')
+    @$element.githubRepo()
 
   describe 'Github API', ->
     it 'should call the correct url', ->


  describe 'Repositories', ->
    it 'should be a div.repositories', ->
      $element = $( '#fixtures' )
      plugin = new $.githubRepo($element)
      expect(
        $element.children('div.repositories').length
      ).toBe(1)

    it 'should contain each repository in a div.repository', ->
      $element = $( '#fixtures' )
      $element.githubRepo()
      expect(
        $element.children('div.repositories').children('div.repository').length
      ).toBe(getJSONFixture('github_user.json').length)

  describe 'A repository', ->
    it 'should be ided by data-github-id', ->
      $element = $( '#fixtures' )
      $element.githubRepo()
      data = getJSONFixture('github_user.json')
      for repo in data
        expect(

        ).toContainElement('.repository[data-github-id="'+repo.id+'"]')

    it 'should have the same structure as a twbs panel', ->
      $('#fixtures div.repositories div.repository').each (i, e)->
        expect(e).toBeMatchedBy('div.panel.panel-default')
        children = $(e).children('*')
