Skip to content

Commit 9f3a646

Browse files
committed
Fix spec
1 parent 3cf5d8f commit 9f3a646

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

spec/v3/services/preferences/for_organization_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
"@representation" => "standard",
5252
"name" => "private_insights_visibility",
5353
"value" => "admins"
54+
}, {
55+
"@type" => "preference",
56+
"@href" => "/v3/org/#{organization.id}/preference/consume_oss_credits",
57+
"@representation" => "standard",
58+
"name" => "consume_oss_credits",
59+
"value" => true
5460
}
5561
]
5662
)
@@ -60,6 +66,7 @@
6066
describe 'some preference has been set' do
6167
before do
6268
organization.preferences.update(:private_insights_visibility, 'members')
69+
organization.preferences.update(:consume_oss_credits, false)
6370
end
6471

6572
it 'returns the set value merged with the defaults' do
@@ -74,6 +81,12 @@
7481
"@representation" => "standard",
7582
"name" => "private_insights_visibility",
7683
"value" => "members"
84+
}, {
85+
"@type" => "preference",
86+
"@href" => "/v3/org/#{organization.id}/preference/consume_oss_credits",
87+
"@representation" => "standard",
88+
"name" => "consume_oss_credits",
89+
"value" => false
7790
}
7891
]
7992
)

spec/v3/services/preferences/for_user_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"@representation" => "standard",
3333
"name" => "private_insights_visibility",
3434
"value" => "private"
35+
}, {
36+
"@type" => "preference",
37+
"@href" => "/v3/preference/consume_oss_credits",
38+
"@representation" => "standard",
39+
"name" => "consume_oss_credits",
40+
"value" => true
3541
}
3642
]
3743
)
@@ -41,6 +47,7 @@
4147
describe 'authenticated, user has prefs' do
4248
before do
4349
user.preferences.update(:build_emails, false)
50+
user.preferences.update(:consume_oss_credits, false)
4451
user.preferences.update(:private_insights_visibility, 'public')
4552
get("/v3/preferences", {}, auth_headers)
4653
end
@@ -65,6 +72,12 @@
6572
"@representation" => "standard",
6673
"name" => "private_insights_visibility",
6774
"value" => "public"
75+
}, {
76+
"@type" => "preference",
77+
"@href" => "/v3/preference/consume_oss_credits",
78+
"@representation" => "standard",
79+
"name" => "consume_oss_credits",
80+
"value" => false
6881
}
6982
]
7083
)

0 commit comments

Comments
 (0)