FIX: Add button_class arguments to the build_action functions

FIX: Add button_class arguments to the build_action functions

Follow-up to 770a712b3839eb9ebc08a3895460cafa5b9b3436

diff --git a/models/reviewable_akismet_post.rb b/models/reviewable_akismet_post.rb
index afc5844..c93a053 100644
--- a/models/reviewable_akismet_post.rb
+++ b/models/reviewable_akismet_post.rb
@@ -64,11 +64,12 @@ class ReviewableAkismetPost < Reviewable
     end
   end
 
-  def build_action(actions, id, icon:, bundle: nil, confirm: false)
+  def build_action(actions, id, icon:, bundle: nil, confirm: false, button_class: nil)
     actions.add(id, bundle: bundle) do |action|
       action.icon = icon
       action.label = "js.akismet.#{id}"
       action.confirm_message = 'js.akismet.reviewable_delete_prompt' if confirm
+      action.button_class = button_class
     end
   end
 
diff --git a/models/reviewable_akismet_user.rb b/models/reviewable_akismet_user.rb
index f02f633..26d77b2 100644
--- a/models/reviewable_akismet_user.rb
+++ b/models/reviewable_akismet_user.rb
@@ -47,11 +47,12 @@ class ReviewableAkismetUser < Reviewable
     end
   end
 
-  def build_action(actions, id, icon:, bundle: nil, confirm: false)
+  def build_action(actions, id, icon:, bundle: nil, confirm: false, button_class: nil)
     actions.add(id, bundle: bundle) do |action|
       action.icon = icon
       action.label = "js.akismet.#{id}"
       action.confirm_message = 'js.akismet.reviewable_delete_prompt' if confirm
+      action.button_class = button_class
     end
   end
 
diff --git a/spec/models/reviewable_akismet_post_spec.rb b/spec/models/reviewable_akismet_post_spec.rb
index 4deee26..50d6884 100644
--- a/spec/models/reviewable_akismet_post_spec.rb
+++ b/spec/models/reviewable_akismet_post_spec.rb
@@ -44,6 +44,10 @@ describe 'ReviewableAkismetPost', if: defined?(Reviewable) do
       actions = reviewable_actions(guardian)
 
       expect(actions.has?(:confirm_delete)).to be true
+
+      expect(actions.to_a.
+        find { |a| a.id == :confirm_delete }.button_class).
+        to eq("btn-danger")
     end
 
     it 'Excludes the confirm delete action when the user is not an staff member' do
diff --git a/spec/models/reviewable_akismet_user_spec.rb b/spec/models/reviewable_akismet_user_spec.rb
index 7727366..5dc25e9 100644
--- a/spec/models/reviewable_akismet_user_spec.rb
+++ b/spec/models/reviewable_akismet_user_spec.rb
@@ -32,6 +32,10 @@ describe 'ReviewableAkismetUser', if: defined?(Reviewable) do
       actions = reviewable_actions(guardian)
 
       expect(actions.has?(:reject_user_delete)).to be true
+
+      expect(actions.to_a.
+        find { |a| a.id == :reject_user_delete }.button_class).
+        to eq("btn-danger")
     end
 
     it 'excludes the confirm delete action when the user is not an staff member' do

GitHub sha: d079c2ee