require 'spec_helper'

describe Travis::Api::V2::Http::Hooks do
  include Travis::Testing::Stubs

  let(:data) {
    r = repository
    r.stubs(:admin?).returns(true)
    Travis::Api::V2::Http::Hooks.new([r]).data
  }

  it 'hooks' do
    data['hooks'].should == [
      {
        'id' => 1,
        'name' => 'minimal',
        'owner_name' => 'svenfuchs',
        'description' => 'the repo description',
        'active' => true,
        'private' => false,
        'admin' => true
      }
    ]
  end
end

require 'spec_helper'

describe Travis::Api::V2::Http::Hooks do
  include Travis::Testing::Stubs

  let(:data) { Travis::Api::V2::Http::Hooks.new([repository]).data }

  it 'hooks' do
    data['hooks'].should == [
      {
        'id' => 1,
        'name' => 'minimal',
        'owner_name' => 'svenfuchs',
        'description' => 'the repo description',
        'active' => true,
        'private' => false
      }
    ]
  end
end

--- 
+++ 
@@ -3,7 +3,11 @@
 describe Travis::Api::V2::Http::Hooks do
   include Travis::Testing::Stubs
 
-  let(:data) { Travis::Api::V2::Http::Hooks.new([repository]).data }
+  let(:data) {
+    r = repository
+    r.stubs(:admin?).returns(true)
+    Travis::Api::V2::Http::Hooks.new([r]).data
+  }
 
   it 'hooks' do
     data['hooks'].should == [
@@ -13,7 +17,8 @@
         'owner_name' => 'svenfuchs',
         'description' => 'the repo description',
         'active' => true,
-        'private' => false
+        'private' => false,
+        'admin' => true
       }
     ]
   end
Fix API data hooks spec
