grant the users badges
This commit is contained in:
parent
14dd31b027
commit
1549a47088
|
@ -30,6 +30,10 @@ module DiscourseDonations
|
||||||
store = PluginStore.get('discourse-donations', 'group:add') || []
|
store = PluginStore.get('discourse-donations', 'group:add') || []
|
||||||
PluginStore.set('discourse-donations', 'group:add', store << email)
|
PluginStore.set('discourse-donations', 'group:add', store << email)
|
||||||
end
|
end
|
||||||
|
if badge_name.present?
|
||||||
|
store = PluginStore.get('discourse-donations', 'badge:grant') || []
|
||||||
|
PluginStore.set('discourse-donations', 'badge:grant', store << email)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -49,13 +49,13 @@ module DiscourseDonations
|
||||||
expect(response_rewards).to be_empty
|
expect(response_rewards).to be_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'stores the email in group:add' do
|
it 'stores the email in group:add and badge:grant' do
|
||||||
PluginStore.expects(:get).with('discourse-donations', 'group:add').returns([])
|
PluginStore.expects(:get).with('discourse-donations', 'group:add').returns([])
|
||||||
PluginStore.expects(:set).with('discourse-donations', 'group:add', [params[:email]])
|
PluginStore.expects(:set).with('discourse-donations', 'group:add', [params[:email]])
|
||||||
|
PluginStore.expects(:get).with('discourse-donations', 'badge:grant').returns([])
|
||||||
|
PluginStore.expects(:set).with('discourse-donations', 'badge:grant', [params[:email]])
|
||||||
post :create, params
|
post :create, params
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'enqueues awarding a badge'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'logged in user' do
|
describe 'logged in user' do
|
||||||
|
|
Loading…
Reference in New Issue