add a test that demonstrates the change to the query on this branch supports the old params and the new v3 namespace params, and add the dirty flag for json column updates
This commit is contained in:
parent
3585a52ba5
commit
ddc6a3704e
|
@ -11,7 +11,8 @@ module Travis::API::V3
|
|||
end
|
||||
|
||||
def update(settings = {})
|
||||
repository.user_settings.update(settings)
|
||||
repository.settings = repository.user_settings.update(settings).to_json
|
||||
repository.settings_will_change!
|
||||
repository.save!
|
||||
end
|
||||
end
|
||||
|
|
|
@ -91,7 +91,7 @@ describe Travis::API::V3::Services::Settings, set_app: true do
|
|||
end
|
||||
|
||||
describe 'authenticated, existing repo' do
|
||||
let(:params) { JSON.dump('settings.build_pushes' => false) }
|
||||
let(:params) { JSON.dump('settings.build_pushes' => false, 'maximum_number_of_builds' => 4) }
|
||||
|
||||
before do
|
||||
repo.update_attributes(settings: JSON.dump('maximum_number_of_builds' => 20))
|
||||
|
@ -105,8 +105,9 @@ describe Travis::API::V3::Services::Settings, set_app: true do
|
|||
'builds_only_with_travis_yml' => false,
|
||||
'build_pushes' => false,
|
||||
'build_pull_requests' => true,
|
||||
'maximum_number_of_builds' => 20
|
||||
'maximum_number_of_builds' => 4
|
||||
)
|
||||
expect(repo.reload.user_settings.maximum_number_of_builds).to eq(4)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user