mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
FIX: roll up staff action wasn't working
This commit is contained in:
parent
3fd4fc679e
commit
4e735e8aab
2 changed files with 13 additions and 2 deletions
|
@ -165,9 +165,9 @@ class StaffActionLogger
|
|||
}))
|
||||
end
|
||||
|
||||
def log_roll_up(subnets)
|
||||
def log_roll_up(subnets, opts={})
|
||||
UserHistory.create(params(opts).merge({
|
||||
action: UserHistory.action[:roll_up],
|
||||
action: UserHistory.actions[:roll_up],
|
||||
details: subnets.join(", ")
|
||||
}))
|
||||
end
|
||||
|
|
|
@ -220,4 +220,15 @@ describe StaffActionLogger do
|
|||
log_record.details.should == badge.name
|
||||
end
|
||||
end
|
||||
|
||||
describe 'log_roll_up' do
|
||||
let(:subnets) { ["1.2.3.0/24", "42.42.42.0/24"] }
|
||||
subject(:log_roll_up) { described_class.new(admin).log_roll_up(subnets) }
|
||||
|
||||
it 'creates a new UserHistory record' do
|
||||
log_record = logger.log_roll_up(subnets)
|
||||
log_record.should be_valid
|
||||
log_record.details.should == subnets.join(", ")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue