From 696185e3cda8f9509aa2d6d3c9ab349e536ef003 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 16 Jul 2014 18:11:20 +0200 Subject: [PATCH] Return repository_id for env vars --- Gemfile.lock | 2 +- lib/travis/api/v2/http/env_var.rb | 2 +- spec/integration/v2/settings/env_vars_spec.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 644a9cfa..fa11334b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-core.git - revision: 0b46e3bc59c18be16a292f1d3b5cbe3f4e8bb7d3 + revision: ad2942bfce79a439743422290d4eb859d68a4424 specs: travis-core (0.0.1) actionmailer (~> 3.2.19) diff --git a/lib/travis/api/v2/http/env_var.rb b/lib/travis/api/v2/http/env_var.rb index 81bd7d3c..864392a1 100644 --- a/lib/travis/api/v2/http/env_var.rb +++ b/lib/travis/api/v2/http/env_var.rb @@ -3,7 +3,7 @@ module Travis module V2 module Http class EnvVar < Travis::Api::Serializer - attributes :id, :name, :value, :public + attributes :id, :name, :value, :public, :repository_id def value if object.public? diff --git a/spec/integration/v2/settings/env_vars_spec.rb b/spec/integration/v2/settings/env_vars_spec.rb index 2e5a442a..90a7d460 100644 --- a/spec/integration/v2/settings/env_vars_spec.rb +++ b/spec/integration/v2/settings/env_vars_spec.rb @@ -22,6 +22,7 @@ describe Travis::Api::App::SettingsEndpoint do json['env_var']['name'].should == 'FOO' json['env_var']['id'].should == record.id json['env_var']['public'].should be_false + json['env_var']['repository_id'].should == repo.id json['env_var'].should_not have_key('value') end @@ -45,6 +46,7 @@ describe Travis::Api::App::SettingsEndpoint do key = json['env_vars'].first key['name'].should == 'FOO' key['id'].should == record.id + key['repository_id'].should == repo.id key['public'].should be_false key.should_not have_key('value') end