2017-04-20 20:26:43 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
module DiscourseDonations
|
|
|
|
RSpec.describe DiscourseDonations::Rewards do
|
2017-04-20 22:08:52 -04:00
|
|
|
let(:grp) { Fabricate(:group) }
|
2017-04-20 20:26:43 -04:00
|
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
subject { described_class.new(user) }
|
|
|
|
|
|
|
|
it 'adds the user to a group' do
|
|
|
|
Group.expects(:find_by_name).with(grp.name).returns(grp)
|
|
|
|
grp.expects(:add).with(user)
|
|
|
|
subject.add_to_group(grp.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'grants the user a badge'
|
|
|
|
end
|
|
|
|
end
|