Update code and specs for newest travis-core changes
This commit is contained in:
parent
60c300aeec
commit
fa56e4cfa0
|
@ -6,8 +6,9 @@ describe Travis::Api::App::SettingsEndpoint do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
model_class = Class.new(Repository::Settings::Model) do
|
model_class = Class.new(Repository::Settings::Model) do
|
||||||
field :name
|
attribute :id, String
|
||||||
field :secret, encrypted: true
|
attribute :name, String
|
||||||
|
attribute :secret, Travis::Settings::EncryptedValue
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :secret, presence: true
|
validates :secret, presence: true
|
||||||
|
@ -16,7 +17,7 @@ describe Travis::Api::App::SettingsEndpoint do
|
||||||
model model_class
|
model model_class
|
||||||
end
|
end
|
||||||
Repository::Settings.class_eval do
|
Repository::Settings.class_eval do
|
||||||
register :items, collection_class
|
attribute :items, collection_class
|
||||||
end
|
end
|
||||||
serializer_class = Class.new(Travis::Api::Serializer) do
|
serializer_class = Class.new(Travis::Api::Serializer) do
|
||||||
attributes :id, :name
|
attributes :id, :name
|
||||||
|
@ -105,7 +106,7 @@ describe Travis::Api::App::SettingsEndpoint do
|
||||||
'code' => 'missing_field'
|
'code' => 'missing_field'
|
||||||
}]
|
}]
|
||||||
|
|
||||||
repo.reload.settings.items.length.should == 0
|
repo.reload.settings.items.to_a.length.should == 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ describe Travis::Api::App::SettingsEndpoint do
|
||||||
'code' => 'missing_field'
|
'code' => 'missing_field'
|
||||||
}]
|
}]
|
||||||
|
|
||||||
repo.reload.settings.env_vars.length.should == 0
|
repo.reload.settings.env_vars.to_a.length.should == 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user