Skip to content

Commit 0a88e2b

Browse files
authored
Merge pull request #1151 from AndriiMysko/oss-credit-option-fix-am
OSS credit option on by default
2 parents 4be9352 + bdc3ff2 commit 0a88e2b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/travis/api/v3/models/organization_preferences.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Travis::API::V3
44
class Models::OrganizationPreferences < Models::JsonSlice
55
child Models::Preference
66

7-
attribute :consume_oss_credits, Boolean, default: false
7+
attribute :consume_oss_credits, Boolean, default: true
88

99
# whether to show insights about the organization's private repositories to
1010
# only admins, all members of the organization, or everybody (public) (note:

lib/travis/api/v3/models/user_preferences.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Models::UserPreferences < Models::JsonSlice
66

77
attribute :build_emails, Boolean, default: true
88

9-
attribute :consume_oss_credits, Boolean, default: false
9+
attribute :consume_oss_credits, Boolean, default: true
1010

1111
# whether to show insights about the user's private repositories to
1212
# everybody or keep them only for the user (note: insights about public

spec/v3/services/preferences/for_organization_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@href" => "/v3/org/#{organization.id}/preference/consume_oss_credits",
5151
"@representation" => "standard",
5252
"name" => "consume_oss_credits",
53-
"value" => false
53+
"value" => true
5454
}, {
5555
"@type" => "preference",
5656
"@href" => "/v3/org/#{organization.id}/preference/private_insights_visibility",
@@ -66,7 +66,7 @@
6666
describe 'some preference has been set' do
6767
before do
6868
organization.preferences.update(:private_insights_visibility, 'members')
69-
organization.preferences.update(:consume_oss_credits, true)
69+
organization.preferences.update(:consume_oss_credits, false)
7070
end
7171

7272
it 'returns the set value merged with the defaults' do
@@ -80,7 +80,7 @@
8080
"@href" => "/v3/org/#{organization.id}/preference/consume_oss_credits",
8181
"@representation" => "standard",
8282
"name" => "consume_oss_credits",
83-
"value" => true
83+
"value" => false
8484
}, {
8585
"@type" => "preference",
8686
"@href" => "/v3/org/#{organization.id}/preference/private_insights_visibility",

spec/v3/services/preferences/for_user_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@href" => "/v3/preference/consume_oss_credits",
3232
"@representation" => "standard",
3333
"name" => "consume_oss_credits",
34-
"value" => false
34+
"value" => true
3535
}, {
3636
"@type" => "preference",
3737
"@href" => "/v3/preference/private_insights_visibility",
@@ -47,7 +47,7 @@
4747
describe 'authenticated, user has prefs' do
4848
before do
4949
user.preferences.update(:build_emails, false)
50-
user.preferences.update(:consume_oss_credits, true)
50+
user.preferences.update(:consume_oss_credits, false)
5151
user.preferences.update(:private_insights_visibility, 'public')
5252
get("/v3/preferences", {}, auth_headers)
5353
end
@@ -71,7 +71,7 @@
7171
"@href" => "/v3/preference/consume_oss_credits",
7272
"@representation" => "standard",
7373
"name" => "consume_oss_credits",
74-
"value" => true
74+
"value" => false
7575
}, {
7676
"@type" => "preference",
7777
"@href" => "/v3/preference/private_insights_visibility",

0 commit comments

Comments
 (0)